1.

How many data members can a class contain?(a) 27(b) 255(c) 1024(d) As many as requiredI have been asked this question during an interview.Query is from Data Members in portion Class Members & Types of Object Oriented Programming

Answer»

Right answer is (d) As many as REQUIRED

The best I can EXPLAIN: Any CLASS can have as many data members as required. The only RESTRICTION that may arise is when there is not enough memory space. This gives FLEXIBILITY to define a class with best properties possible.



Discussion

No Comment Found

Related InterviewSolutions