1.

Which of these methods must be made static?(a) main()(b) delete()(c) run()(d) finalize()The question was posed to me during an internship interview.My question comes from Arrays Revisited & Keyword static in portion Classes and Methods of Java

Answer»

Correct option is (a) MAIN()

To explain: main() METHOD must be declared STATIC, main() method is called by Java runtime system before any object of any class EXISTS.



Discussion

No Comment Found

Related InterviewSolutions