[英]I am having a confusion in array object creation and assignment of it the new element
[英]Array initialization/assignment confusion
有人可以告訴我DayPlanner()
默認構造函數中發生了什么嗎? 以下是我教授的筆記,但我不明白他為什么要使用new HomeObject[SIZE];
兩次。
private HomeObject[] home = new HomeObject[SIZE]; // This is in the DayPlanner class
public DayPlanner() { // DayPlanner constructor
home = new HomeObject[SIZE];
}
我認為有一個錯誤。 可能必須在構造函數中實例化home
數組。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.