It enables classes to acquire properties of other classes.
The class that inherits the properties is called a child class or subclass, and the class from which the properties are inherited is called a parent class or superclass.
In the example in Figure 1-1, assume that the different types of employees must be able to respond with their compensation to date.
As with a table definition, a class provides a template for objects that share common characteristics.
Each class can contain the following: A class needs to be instantiated before you can use the instance variables or attributes and methods.
JVM is a separate program that is optimized for the specific platform on which you run your Java code.
Figure 1-2 illustrates how Java can maintain platform independence.
You do not have to write specific methods to handle full-time employees and part-time employees. A program that calculates total payroll to date would iterate over all people on payroll, regardless of whether they were full-time or part-time employees or contractors, and add up the values returned from calling the As with other high-level computer languages, the Java source compiles to low-level machine instructions.
In Java, these instructions are known as bytecodes, because each instruction has a uniform size of one byte.In object-oriented programming languages, you can define one or more methods with the same name.These methods can perform different actions and return different values.Encapsulation enables you to write reusable programs.It also enables you to restrict access only to those features of an object that are declared Inheritance is an important feature of object-oriented programming languages.The methods that are declared in the interface are implemented in the classes.