package sec03.ex01;
class A {
A() {
this(9);
System.out.println("1");
}
A(int a) {
// this();
System.out.println("2");
}
}
public class DefaultConstructor {
public static void main(String[] args) {
A a = new A();
System.out.println("");
A a2 = new A(3);
}
}
'매일연습코딩' 카테고리의 다른 글
super() 생성자 (1) | 2024.10.01 |
---|