java 超构造函数_java中的超级构造函数
生活随笔
收集整理的這篇文章主要介紹了
java 超构造函数_java中的超级构造函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
請解釋
public class Contact {
private String contactId;
private String firstName;
private String lastName;
private String email;
private String phoneNumber;
public Contact(String contactId,String firstName,String lastName,String email,String phoneNumber) {
super(); //what does standalone super() define? With no args here?
this.firstName = firstName;
this.lastName = lastName; //when is this used?,when more than one args to be entered?
this.email = email;
this.phoneNumber = phoneNumber;
}
內部沒有參數的Super()意味著要定義多個參數?這是在“this.xxx”的幫助下完成的嗎?
為什么我們在“公共類聯系”本身中定義.為什么我們再次定義并在此處調用其參數?
總結
以上是生活随笔為你收集整理的java 超构造函数_java中的超级构造函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 揭开HTTPS的神秘面纱
- 下一篇: GC算法的评价标准