Abstract class

Any abstract method must be in abstract class, abstract class can have no abstract methods

Can we make a class both final and abstract at the same time?

No, you cannot apply both final and abstract keyword at the class same time because they are exactly opposite of each other. A final class in Java cannot be extended and you cannot use an abstract class without extending and making it a concrete class. As per Java specification, the compiler will throw an error if you try to make a class abstract and final at the same time.

results matching ""

    No results matching ""