I know there have been lots of thread about Java inheritance (and i already read it), but they all stand for \"how it is\", and I need knowledge \"how to change it\". So, we hav
You should use a constructor and possibly a getter
class t1{
public final int a;
public t1() {
this(5);
}
protected t1(int a) {
this.a = a;
}
public void get(){
System.out.println(a);
}
}
class t2 extends t1{
public t2() {
super(1);
}
}