Skip to content

Commit a89b5a0

Browse files
committed
240527 정보처리기사 실기 - Java (2021-3회 1번)
1 parent 5a3c835 commit a89b5a0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

EIP/Java/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,43 @@
340340

341341

342342

343+
#### 2021년 3회 [2개 출제]
344+
345+
- 문제1. 다음 Java 코드에 대한 알맞는 출력값을 쓰시오.
346+
347+
```java
348+
class Connection {
349+
private static Connection _inst = null;
350+
private int count = 0;
351+
static public Connection get() {
352+
if (_inst == null) {
353+
_inst = new Connection();
354+
return _inst;
355+
}
356+
return _inst;
357+
}
358+
public void count() { count ++; }
359+
public int getCount() { return count; }
360+
}
361+
362+
public class testcon {
363+
public static void main(String[] args) {
364+
Connection conn1 = Connection.get();
365+
conn1.count();
366+
Connection conn2 = Connection.get();
367+
conn2.count();
368+
Connection conn3 = Connection.get();
369+
conn3.count();
370+
371+
System.out.print(conn1.getCount());
372+
}
373+
}
374+
```
375+
376+
- [] 3
377+
378+
379+
343380
#### 2022년 3회
344381

345382
- 문제4. 다음 JAVA로 구현된 프로그램을 분석하여 그 실행 결과를 쓰시오. (단, 출력문의 출력 서식을 준수하시오.)

0 commit comments

Comments
 (0)