So i ran this code and I don't understand why I got the output 11:
class Parent{
protected int counter;
public Parent(){counter++;}
}
class Child extends Parent{
public Child(){
System.out.print(counter);}
}
}
public class Test{
public static void main(String [] args){
Parent p = new Child();
System.out.print(p.counter);
}
}