본문 바로가기

100세까지 코딩

검색하기
100세까지 코딩
프로필사진 100세까지 코딩

  • 분류 전체보기 (135)
    • 프론트엔드 (7)
    • 백엔드 (7)
      • 스프링 입문 (7)
    • 코딩테스트 (88)
      • 자바 (46)
      • 파이썬 (39)
    • JAVA (15)
    • CS (13)
      • 컴퓨터 구조 (9)
      • 운영체제 (4)
    • GitHub (4)
Guestbook
Recent Posts
Recent Comments
«   2025/06   »
일 월 화 수 목 금 토
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
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • 관리

목록생성자 (1)

100세까지 코딩

[자바 공부] 상속 & 생성자 (정처기 문제)

문제 class Parent { int x = 100; Parent() { this(500); // this() : 자기자신 객체 생성자 호출 } Parent(int x) { this.x = x; // this : 객체 자기자신을 의미 } int getX() { return x; } } class Child extends Parent { int x = 4000; Child() { this(5000); } Child(int x) { this.x = x; } } public class Main { public static void main(String[] args) { Child obj = new Child(); System.out.println(obj.getX()); } } 풀기 전 생각 정답은 100이라..

JAVA 2023. 8. 10. 02:54
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바