-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprac8_3.java
More file actions
44 lines (34 loc) · 809 Bytes
/
Copy pathprac8_3.java
File metadata and controls
44 lines (34 loc) · 809 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
import java.lang.Math.*;
class squre{
int side;
int length;
int breadth;
int radius;
double pi;
public int area(){
return side * side;
}
public int perimeter(){
return 4 * side;
}
public int rectangle(){
return length * breadth;
}
public double cirlce(){
return Math.PI*radius*radius;
}
}
class prac8_3{
public static void main(String [] args){
squre sq = new squre();
sq.side = 3;
sq.length = 4;
sq.breadth = 6;
sq.radius = 4;
sq.pi = 3.14;
System.out.println(sq.area());
System.out.println(sq.perimeter());
System.out.println(sq.rectangle());
System.out.println(sq.cirlce());
}
}