-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop15.java
More file actions
68 lines (44 loc) · 842 Bytes
/
Copy pathoop15.java
File metadata and controls
68 lines (44 loc) · 842 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
class rect{
private int l,b,h;
int area(){
return l*b;
}
void setl(int l){
this.l=l;
}
int getl(){
return l;
}
void setb(int b){
this.b=b;
}
int getb(){
return b;
}
void seth(int h){
this.h=h;
}
int geth(){
return h;
}
class cuboid extends rect{
int volume(){
return l*b*h;
}
int area(){
return (2*l*b+2*b*h+2*h*l);
}
}
}
public class oop15 {
public static void main(String[] args) {
rect rect = new rect();
rect.getl();
rect.getb();
rect.geth();
rect.setb(5);
rect.seth(7);
rect.setl(5);
System.out.println(rect.area());
}
}