-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
28 lines (24 loc) · 782 Bytes
/
Copy pathTest.java
File metadata and controls
28 lines (24 loc) · 782 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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package java_abstract;
/**
*
* @author thien
*/
public class Test {
public static void main(String[] args) {
ToaDO td1 = new ToaDO(5, 5);
ToaDO td2 = new ToaDO(7, 9);
ToaDO td3 = new ToaDO(12, 1);
// Hinh h = new Hinh(1); lỗi
Hinh h1 = new Diem(td1);
Hinh h2=new HinhTron(10, td2);
Hinh h3 = new HinhChuNhat(5, 10, td3);
System.out.println("DT1 :"+ h1.tinhDienTich());
System.out.println("DT2 :"+ h2.tinhDienTich());
System.out.println("DT3 :"+ h3.tinhDienTich());
}
}