例如: public class Dog{ String name; //屬性public Dog( ){ //建構子name ... C:當類別被實体化(被new過)的時候,建構元是第一個被呼叫並可用來設定屬性的初始化
確定! 回上一頁