Raghunadh Parlapalli
Answered On : Feb 13th, 2013
Thats an excellent question.
Try this, It works. Because main() is a static method. So, We can call static methods from another class static method.
ClassB {
public static void main(String[] args) {
System.out.println("ClassB main() Called");
}
}
ClassA {
public static void main(String[] args) {
System.out.println("ClassA main() Called");
ClassB.main(args);
}
}
Login to rate this answer.