2080 1

Advanced Java Programming208010 marksInterface design and implementation

Why do we need interface? Define an interface named shape with area ( ) method. Create a class named Rectangle with length and breadth circle with radius that implements shape interface. Now create the object of both classes and display their area.

Why do we need interface? Define an interface named shape with area ( ) method. Create a class named Rectangle with length and breadth circle with radius that implements shape interface. Now create the object of both classes and display their area.[10]

Interfaces are needed for the following reasons: 1. Abstraction: Interfaces define a contract that specifies what methods a class must implement, without specifying how they should be implemented. 2. Polymorphism: Interfaces allow objects of different classes to be treated uniformly through a com...

Up nextWrite a Java program to create a UI with three labels and three text boxes for First Numbe