1.

Which of the following is incorrect?(a) class student{}s;(b) class student{};student s;(c) class student{}s[];(d) class student{}; student s[5];The question was posed to me in an international level competition.I'd like to ask this question from Objects in division OOPs Concept & Features of Object Oriented Programming

Answer»

Right ANSWER is (C) class student{}s[];

The explanation is: The array must be specified with a size. You can’t declare object array, or any other LINEAR array without specifying its size. It’s a MANDATORY field.



Discussion

No Comment Found

Related InterviewSolutions