1.

Which among the following is not allowed for data member declaration?(a) int a;(b) static int a;(c) abstract a;(d) Boolean a;The question was asked during an internship interview.This intriguing question comes from Data Members in section Class Members & Types of Object Oriented Programming

Answer»

The CORRECT answer is (c) abstract a;

To explain: The abstract KEYWORD in the declaration of data members is not allowed. This is because the abstract keyword FEATURES can’t be used with the data members of the class. We can have all other SYNTAX given, but not abstract.



Discussion

No Comment Found

Related InterviewSolutions