-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArea.java
More file actions
18 lines (18 loc) · 757 Bytes
/
Area.java
File metadata and controls
18 lines (18 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class Area {
public static void main(String[] var0) {
Shape var1 = new Shape();
System.out.println(var1.l);
var1.area();
Shape var2 = new Shape(2.0);
System.out.println(var1.b);
System.out.println(var2.l);
System.out.println("Area of Shape with one side: " + var2.area(2.0));
System.out.println("Area of Shape with two sides: " + var2.area(3.0, 5.0));
Triangle var3 = new Triangle(2.0, 4.0);
System.out.println(var3.b);
System.out.println("Area of the triangle with all side: " + var3.area(2.0, 4.0, 6.0));
System.out.println("Area of Triangle with one side and height: " + var3.area(2.0, 4.0));
var3.area();
System.out.println(var3.h);
}
}