프로그래밍의 기초(의사 코드 트레이스)
클래스 Counter는 인스턴스마다 정수형 멤버 변수 count(생성 시 0)를 가지며, 메서드 inc()는 자신의 count에 1을 더한다. 다음 프로그램을 실행한 후의 x의 값은?
Counter: c1 ← new Counter()
Counter: c2 ← new Counter()
c1.inc()
c1.inc()
c2.inc()
c1.inc()
integer: x ← c1.count × 10 + c2.count
- A13
- B31
- C44