★★ Java の宿題ここで答えます Part 65 ★★
at TECH
706:デフォルトの名無しさん
08/07/30 15:15:02
>>703 仕様も含めて課題の疑問点は普通は先生に聞くものだと思うよ
// Nonsense.java
public class Nonsense {
private int i;
private int j;
private int k;
private int l;
public Nonsense(int i, int j, int k, int l) {
this.i = i;
this.j = j;
this.k = k;
this.l = l;
}
public int add() {
return i + j + k + l;
}
public int mul() {
return i * j * k * l;
}
public String concat() {
return "" + i + j + k + l;
}
}
// NonsenseUser.java
public class NonsenseUser {
public static void main(String[] args) {
Nonsense nonsense = new Nonsense(1, 2, 3, 4);
System.out.println("add: " + nonsense.add() + ", mul: " + nonsense.mul() + ", concat: " + nonsense.concat());
}
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5464日前に更新/381 KB
担当:undef