O'Reilly logo

The class of Java by Pravin Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 7

Abstract Classes and Interfaces

In Chapter 6, we have looked at the keyword final, let us now look at another keyword in Java called abstract. The keyword abstract in a sense is opposite of final. It is a modifier only for methods and classes. The modifiers abstract and final cannot be used together. A method or a class cannot be declared to be both abstract and final. A final method prevents overriding, whereas an abstract method promotes overriding. A final class prevents inheritance, whereas an abstract class promotes inheritance.

7.1 ABSTRACT CLASSES AND ABSTRACT METHODS

What is the meaning of declaring a method as abstract. When we declare a method as abstract, then we do not provide an implementation of the method, and the method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required