Why does the below code print \"Main\"?
public class Main { public static void method() { System.out.println(\"Main\"); } public sta
Static methods are resolved on the compile-time type of the variable. m is of type Main, so the method in Main is called.
m
Main
If you change it to SubMain m ..., then the method on SubMain will be called.
SubMain m ...
SubMain