class parent {
parent() {
System.out.println("parent");
}
}
public class child extends parent {
{
System.out.println("non static block");
}
child() {
super();
System.out.println("idk");
}
public static void main(String[] args) {
new child();
}
}
output:
parent
non static block
idk
I was expecting output to be
non static block
parent
idk
why didn't non static block run first??