1.

Which of these statement is incorrect?(a) Every class must contain a main() method(b) Applets do not require a main() method at all(c) There can be only one main() method in a program(d) main() method must be made publicThis question was posed to me in an online quiz.This interesting question is from Class Fundamentals & Declaring objects topic in division Classes and Methods of Java

Answer»

Right choice is (a) Every class MUST contain a main() method

To EXPLAIN I WOULD say: Every class does not need to have a main() method, there can be only one main() method which is made PUBLIC.



Discussion

No Comment Found

Related InterviewSolutions