일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 카데인 알고리즘
- R
- heroku
- 수학
- array
- SpringBoot 2
- 자바 스레드 실행 순서 제어
- JAVA11
- Easy
- input
- 자바 thread 실행 순서 제어
- 사칙연산
- 자바입력
- scanner
- hash table
- Kadane's Algorithm
- Today
- Total
목록Design Pattern (42)
DeFacto-Standard IT
1. 가정 - 게임에서 마시는 체력포션을 구현한다. - 포션을 사용하면 각 포션의 색깔을 출력한다. - 유저는 포션을 마실 수 있다. - 포션은 포션 상점으로부터 제공받는다. 2. Naive Code - RedPotionpublic class RedPotion { public void use() { System.out.println("using RedPotion"); } }체력포션. 자신의 역할을 수행한다. - NaiveUserpublic class NaiveUser { private RedPotion redPotion; public void setRedPotion(RedPotion redPotion) { this.redPotion = redPotion; } public void drink() { if(..
1. 가정 - 여러 사람이 동시에 프린터를 사용하는 경우를 구현한다. - 여러 사람은 스레드로서 구현한다. - 프린터는 1대밖에 존재하지 않는다. 2. Naive Code - NaivePrinterpublic class NaivePrinter { private static NaivePrinter naivePrinter; private NaivePrinter(){ } public static NaivePrinter getNaivePrinter(){ if(naivePrinter ==null) naivePrinter = new NaivePrinter(); return naivePrinter; } public void print(String string) { System.out.println(string); }..