Which among the following is not allowed for data member declaration?

Which among the following is not allowed for data member declaration?
A. int a;
B. static int a;
C. abstract a;
D. Boolean a;
 
Answer: c
Explanation: 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.
 

Tìm kiếm

Back
Top