14 Interfaces
An interface is a group of related methods with empty bodies. In other words, it is a collection of abstract methods. An interface is not a class. A class implements an interface to inherit the abstract method of the interface.
The following code shows an interface Cars, that has method make() and price().
The following steps show class Nissan which implements the Cars interface and define its abstract method make() and price().
14.1 | Create a new class in Eclipse
1. Create a new class in Eclipse as defined in the previous post.
2. Provide reference of Cars interface as shown in below screen.
3. Click on the Finish button.
14.2 | Created Nissan Class
Created Nissan class looks like below screen
The following code shows class Nissan which implements the Cars interface and defines its abstract method make() and price().
The below screen is the output of the above codes.
1 thought on “14 Interfaces”
Comments are closed.
In this article you shared lots of interesting information. Thanks a lot.
Placement Training in Chennai
best training and placement institute in chennai
Placement Training in Porur
soft skills training in chennai
soft skills training institutes in chennai
clinical sas training in chennai
SAS Training in Chennai