Question: 2. Write the definition of interfaces and classes using the following details: 4 Marks i. Define an interface class Figure that has method area ().
2. Write the definition of interfaces and classes using the following details: 4 Marks i. Define an interface class Figure that has method area (). ii. Declare a final class field PI(PI=3.14) inside the class Figure. iii. Create Triangle, Rectangle classes as the subclasses of Figure class. iv. Declare fields side1, side2 in the Triangle and Rectangle classes v. Implement the method area() in all the subclasses classes Triangle, Rectangle and.
I want the solution to be in java bluej
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
