- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBoxMain.java
More file actions
Latest commit
34 lines (34 loc) · 600 Bytes
/
Copy pathBoxMain.java
File metadata and controls
34 lines (34 loc) · 600 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
classBox
{
intlength,breadth,height;
Box(intlength, intbreadth, intheight)
{
this.length=length;
this.breadth=breadth;
this.height=height;
}
}
classBox3dextendsBox
{
Box3d(intlength, intbreadth, intheight)
{
super(length, breadth, height);
}
publicvoidarea()
{
System.out.println(2*(length*breadth+length*height+height*breadth));
}
publicvoidvolume()
{
System.out.println(length*breadth*height);
}
}
classBoxMain
{
publicstaticvoidmain(Stringargs[])
{
Box3dobj = newBox3d(10,1,3);
obj.area();
obj.volume();
}
}