Why does the below code print \"Main\"?
public class Main
{
public static void method()
{
System.out.println(\"Main\");
}
public sta
static methods are statically binded with their class name because m is type of Main class then after compilation it would look like as following Main.method(); after compilation of your class run the following command javap -c Main u can see the jvm assembly code for Main class and u would see following m.method //invoke static invoke static ,invoke special tells that static binding invoke special,invoke interface tells that dynamic binding