You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Derive a class Square from class Rectangle. Create an interface with only one method called Area(). Impliment this interface in all classes. Include appropriate data members and constructors in all classes.
interface Findarea{
public void area();
}
class Rectangle implements Findarea{
int l, b;
public Rectangle(int length, int bredth){
l = length;
b = bredth;
}
public void area(){
System.out.println("Area of Rectanle : " + (l*b));