★★ Java の宿題ここで答えます Part 63 ★★
■ このスレッドは過去ログ倉庫に格納されています
0376デフォルトの名無しさん
2007/10/25(木) 01:14:47コンストラクタ追加
public Meibo(){
this.name = "お前";
this.age = 23;
this.occupation = "自宅警備員";
}
public Meibo(String name){
this.name = name;
this.age = 60
this.occupation = "TBS";
}
public Meibo(String name,int age){
if(age <= 0)throws new IllegalArgumentException("age must be positive");
this.name = name;
this.age = age;
this.occupation = "ネトウヨ";
}
■ このスレッドは過去ログ倉庫に格納されています