LAB10
LAB10
Heritage Sukkur.
________________________________________________________________________________
Lab Exercises:
1. Interface Implementation:
Define an interface Shape with methods calculateArea() and calculatePerimeter().
Implement the Shape interface with classes Circle and Rectangle.
Test the implementation by creating instances of Circle and Rectangle and calling
their methods.
3. Inheritance in Interfaces:
Define an interface Animal with a method eat().
Define a sub-interface Mammal that extends Animal and adds a method giveBirth().
Implement the Mammal interface with a class Dog.
Test the eat() and giveBirth() methods of Dog.
Aror University of Art, Architecture, Design &
Heritage Sukkur.
________________________________________________________________________________