Java - Can we have a Class Abstract and Final ? Can we have a method Pure Virtual and Final ?


Before Answering these questions, Lets see the definition of Abstract Class and Final Class.

Abstract Class is the class which is not supposed to be instantiated whereas Final Class is the class which can't be sub classed. So Abstract Final Class in literal meaning is the Class that can neither be instantiated nor be sub classed,  and hence a useless class.

We get Compile time error if we declare a Class Abstract and Final.

Similarly Methods being pure virtual and final makes no sense for having such method. We get compile time error in this case too.


200 Core Java Interview Questions and Answers