class name refactor
This commit is contained in:
parent
027f011e67
commit
969f40da6e
@ -1,6 +1,6 @@
|
|||||||
package com.baeldung.keyword;
|
package com.baeldung.keyword;
|
||||||
|
|
||||||
import com.baeldung.keyword.superkeyword.SubClass;
|
import com.baeldung.keyword.superkeyword.SuperSub;
|
||||||
import com.baeldung.keyword.thiskeyword.ThisKeyword;
|
import com.baeldung.keyword.thiskeyword.ThisKeyword;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -11,6 +11,6 @@ public class KeywordDemo {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
ThisKeyword keyword = new ThisKeyword();
|
ThisKeyword keyword = new ThisKeyword();
|
||||||
|
|
||||||
SubClass child = new SubClass("message from the child class");
|
SuperSub child = new SuperSub("message from the child class");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,14 @@ package com.baeldung.keyword.superkeyword;
|
|||||||
/**
|
/**
|
||||||
* Created by Gebruiker on 5/14/2018.
|
* Created by Gebruiker on 5/14/2018.
|
||||||
*/
|
*/
|
||||||
public class SuperKeyword {
|
public class SuperBase {
|
||||||
|
|
||||||
String message = "super class";
|
String message = "super class";
|
||||||
|
|
||||||
public SuperKeyword() {
|
public SuperBase() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SuperKeyword(String message) {
|
public SuperBase(String message) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
@ -3,15 +3,15 @@ package com.baeldung.keyword.superkeyword;
|
|||||||
/**
|
/**
|
||||||
* Created by Gebruiker on 5/15/2018.
|
* Created by Gebruiker on 5/15/2018.
|
||||||
*/
|
*/
|
||||||
public class SubClass extends SuperKeyword {
|
public class SuperSub extends SuperBase {
|
||||||
|
|
||||||
String message = "child class";
|
String message = "child class";
|
||||||
|
|
||||||
public SubClass(String message) {
|
public SuperSub(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubClass() {
|
public SuperSub() {
|
||||||
super.printMessage();
|
super.printMessage();
|
||||||
printMessage();
|
printMessage();
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user