1.

How many classes can be defined in a single program?(a) Only 1(b) Only 100(c) Only 999(d) As many as you wantI had been asked this question in quiz.Question is taken from OOPs Basic Concepts topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (d) As MANY as you want

The best EXPLANATION: Any NUMBER of classes can be DEFINED inside a program, provided that their names are different. In java, if public class is PRESENT then it must have the same name as that of file.



Discussion

No Comment Found

Related InterviewSolutions