Sabtu, 31 Juli 2021

Is it possible to have an abstract method in a final class? Example

This is one of the interesting core Java questions which was asked to one of my readers recently during a telephonic interview for a Java developer job interview. Even though he knows that you cannot make an abstract class final in Java, he got confused by the wording of the methods. The answer is simple, No, it's not possible to have an abstract method in a final class in Java. Why? because as soon as you declare an abstract method in a Java class, the class automatically becomes an abstract class and you cannot make an abstract class final in Java as discussed before, hence it's not possible to have an abstract method in a final class in Java.

Lorem ipsum is simply dummy text of the printing and typesetting industry.

Comments


EmoticonEmoticon