Skip to content

Commit f7c3503

Browse files
committed
240624 정보처리기사 실기 - Java (2023-1회 20번)
1 parent 1d20feb commit f7c3503

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

EIP/Java/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -643,3 +643,39 @@
643643
```
644644

645645
- [] Vehicle name: Spark
646+
647+
- 문제20. 다음 Java 로 구현된 프로그램을 분석하여 그 실행 결과를 쓰시오. (단, 출력문의 출력 서식을 준수하시오)
648+
649+
```java
650+
class Parent {
651+
int x = 100;
652+
Parent() {
653+
this(500);
654+
}
655+
Parent(int x) {
656+
this.x = x;
657+
}
658+
int getX() {
659+
return this.x;
660+
}
661+
}
662+
663+
class Child extends Parent {
664+
int x = 1000;
665+
Child() {
666+
this(5000);
667+
}
668+
Child(int x) {
669+
this.x = x;
670+
}
671+
}
672+
673+
public class Main {
674+
public static void main(String[] args) {
675+
Child obj = new Child();
676+
System.out.println(obj.getX());
677+
}
678+
}
679+
```
680+
681+
- [] 500

0 commit comments

Comments
 (0)