class Room
{
float length;
float breadth;
void getdata(float a, float b)
{
length=a;
breadth=b;
}
}
class RoomArea
{
public static void main(String args[])
{
float area;
Room room1 = new Room();//Create an object room1 from the class Room
room1.getdata(15,20);
area=room1.length * room1.breadth;
System.out.println("Area = "+area);
}
}
0 comments:
Post a Comment