-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
24 lines (21 loc) · 858 Bytes
/
Main.java
File metadata and controls
24 lines (21 loc) · 858 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
public class Main {
public static void main(String[] args) {
RoundHole roundHole = new RoundHole(5);
RoundPeg roundPeg = new RoundPeg(5);
if (roundHole.fits(roundPeg)) {
System.out.println("roundPeg가 들어갈 수 있습니다.");
}
SquarePeg smallSqPeg = new SquarePeg(2);
SquarePeg largeSqPeg = new SquarePeg(20);
SquarePegAdapter smallPeg = new SquarePegAdapter(smallSqPeg);
SquarePegAdapter largePeg = new SquarePegAdapter(largeSqPeg);
// roundHole.fits(smallSqPeg);
// roundHole.fits(largeSqPeg);
if (roundHole.fits(smallPeg)) {
System.out.println("smallPeg가 들어갈 수 있습니다.");
}
if (roundHole.fits(largePeg)) {
System.out.println("largePeg가 들어갈 수 있습니다.");
}
}
}