子クラスが親クラスの値を使用したい時にsuperを使う。
例えば
class main{
public static void main(String[] args) throws Exception {
ChildrenClass c = new ChildrenClass();
}
class MotherClass {
public MotherClass(String str){
System.out.println("str : " + str);
String line = hogehoge;
}
}
class ChildrenClass extends MotherClass {
public ChildernClass(){
super("hoge");
String line = gehogeho;
System.out.println("super.line : " + super.line);
System.out.println("this.line : " + this.line);
}
}
}
出力は
str : hoge super.line : hogehoge this.line : gehogeho
となる。


