Files
java-question/Question08-Method/src/PTra08_08.java
2026-09-09 08:34:32 +09:00

28 lines
749 B
Java
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* PTra08_08.java
* 作成 Rhizome
*------------------------------------------------------------
* Copyright(c) Rhizome Inc. All Rights Reserved.
*/
public class PTra08_08 {
public static void main(String[] args) {
System.out.println(sum(1, 2));
System.out.println(sum(1, 2 ,3));
System.out.println(sum(1, 2, 3, 4));
}
/*
* TODO 以下の仕様でメソッドを作成してください
*
* 戻り値 :int
* メソッド名 :sum
* 引数 :int num1, int num2
*
* 引数で渡された値合計した値を戻り値として返す
*/
//TODO sumを引数3つでオーバーロードしてください。処理は同じ
//TODO sumを引数4つでオーバーロードしてください。処理は同じ
}