public abstract class Parent {
public int testvar = 1;
public void showTestVar() {
System.out.print("testvar: " + this.testvar);
}
}
public class Child extends Parent {
Child() {
testvar = 51;
}
}
class Run {
public static void main(String[] args) {
Child ik = new Child();
ik.showTestVar();
}
}
(Lasīt komentārus)
Nopūsties: