저는 생성자에서 'this'키워드를 연습하고 있습니다. "this"가 생성자를 명시 적으로 호출하는 데 도움이된다는 것을 알게되었습니다. 그러나 실시간으로 그것의 사용은 무엇입니까.명시 적 생성자 호출 사용
명시 적 생성자 호출.
class JBT {
JBT() {
this("JBT");
System.out.println("Inside Constructor without parameter");
}
JBT(String str) {
System.out
.println("Inside Constructor with String parameter as " + str);
}
public static void main(String[] args) {
JBT obj = new JBT();
}
}
은'그러나 당신은 당신이 실제로 당신을 여기 모르거나 무엇을 원하는 것을 명확히 수있는 실제 time.'에서의 사용 무엇인가 이해하기가 힘들어? – SomeJavaGuy