class Parent {
int i;
}
public class Relative extends Parent{
public int i;
public Relative (int a, int b) {
a = super.i;
b = i;
}
public void tell() {
System.out.println(super.i);
System.out.println(i);
}
}
public class Main{
public static void main(String[] args) {
Relative object = new Relative(2, 6);
object.tell();
}
}
Результат:
0
0
Process finished with exit code 0