1.

Can abstract class have main() function defined inside it?(a) Yes, depending on return type of main()(b) Yes, always(c) No, main must not be defined inside abstract class(d) No, because main() is not abstract functionThis question was posed to me in exam.This is a very interesting question from Abstract Class in chapter Classes of Object Oriented Programming

Answer»

Correct choice is (B) Yes, always

To explain: This is a property of abstract class. It can define main() FUNCTION inside it. There is no restriction on its definition and IMPLEMENTATION.



Discussion

No Comment Found

Related InterviewSolutions