-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestGeometricObject.java
More file actions
executable file
·38 lines (36 loc) · 1.23 KB
/
TestGeometricObject.java
File metadata and controls
executable file
·38 lines (36 loc) · 1.23 KB
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
/* */ package ch13;
/* */
/* */
/* */ public class TestGeometricObject
/* */ {
/* */ public static void main(String[] args) {
/* 7 */ GeometricObject geoObject1 = new Circle(5.0D);
/* 8 */ GeometricObject geoObject2 = new Rectangle(5.0D, 3.0D);
/* */
/* 10 */ System.out.println("The two objects have the same area? " +
/* 11 */ equalArea(geoObject1, geoObject2));
/* */
/* */
/* 14 */ displayGeometricObject(geoObject1);
/* */
/* */
/* 17 */ displayGeometricObject(geoObject2);
/* */ }
/* */
/* */
/* */
/* */ public static boolean equalArea(GeometricObject object1, GeometricObject object2) {
/* 23 */ return (object1.getArea() == object2.getArea());
/* */ }
/* */
/* */
/* */ public static void displayGeometricObject(GeometricObject object) {
/* 28 */ System.out.println();
/* 29 */ System.out.println("The area is " + object.getArea());
/* 30 */ System.out.println("The perimeter is " + object.getPerimeter());
/* */ }
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch13/TestGeometricObject.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/