/* * To change this template, choose Tools | Templates * and open the template in the editor. *//** * * @author 2it16 */class Room { int b; int i; Room(int x,int y) { b=x; i=y; } int area() { return b*i; }}class Bedroom extends Room{ int h; Bedroom(int x,int y,int z); { super(x,y); } int volume() { return i*b*h; }}class inher{public static void main(String[] args) { Bedroom r1=new Bedroom(1,2,3); int area=r1.area(); int volume=r1.volume();System.out.print(+area);System.out.print(+volume);}}
/*
ReplyDelete* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author 2it16
*/
class Room {
int b;
int i;
Room(int x,int y)
{
b=x;
i=y;
}
int area()
{
return b*i;
}
}
class Bedroom extends Room
{
int h;
Bedroom(int x,int y,int z);
{
super(x,y);
}
int volume()
{
return i*b*h;
}
}
class inher
{
public static void main(String[] args) {
Bedroom r1=new Bedroom(1,2,3);
int area=r1.area();
int volume=r1.volume();
System.out.print(+area);
System.out.print(+volume);
}
}