Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Inheritance is one of the fundamental principles in object-oriented programming. Inheritance makes code extensible. In Java all classes by default extend the java.lang.Object class. To extend a class, use the extends keyword. Method overriding is another OOP feature directly related to inheritance. It enables you to change the behavior of a method in the parent class. You can prevent your class from being subclassed by using the final keyword.