This is a Java program to show the Implementation of Interface. We have to enter the length and breadth of the rectangle as an input to get Area of rectangle as output.An interface in Java is similar to a class, but the body of an interface can include only abstract methods and final fields (constants). A class implements an interface by providing code for each method declared by the interface.
Here is the source code of the Java Program to show the Partial Implementation of Interface. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.
public void dimensions();
public void area();
public class Interface_Implementation implements area
public void dimensions()
Scanner s=new Scanner(System.in);
public void area()
public static void main(String args)
Interface_Implementation obj=new Interface_Implementation();
$ javac Interface_Implementation.java
$ java Interface_Implementation
Sanfoundry Global Education & Learning Series – 1000 Java Programs.
Here’s the list of Best Reference Books in Java Programming, Data Structures and Algorithms.
, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @