1.

Can abstract classes have static methods (Java)?(a) Yes, always(b) Yes, but depends on code(c) No, never(d) No, static members can’t have different valuesThe question was posed to me in an interview for internship.I'm obligated to ask this question of Abstract Class in section Classes of Object Oriented Programming

Answer»

The CORRECT option is (a) Yes, always

Explanation: There is no restriction on declaring STATIC methods. The only CONDITION is that the virtual functions must have some DEFINITION in the PROGRAM.



Discussion

No Comment Found

Related InterviewSolutions