............... ............... ............... ............... ............... ............... ............... .............
is it possible java can have two main(),1st is super class 2nd is subclass fasion?
Collapse
X
-
Tags: None
-
Hi,
Yes, It is possible. JVM only find the main class of saved file name.
for example:
class A{
public static void main(String args[]){
A a=new A();
System.out.prin tln("A");
}
}
class B extends A{
public static void main(String args[]){
B b=new B();
System.out.prin tln("B");
}
}
Comment