q8-9まで完了
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
public class PTra01_08 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
float fl = 3.14f;
|
||||
// TODO float型の変数 fl を 3.14 で初期化してください。
|
||||
|
||||
System.out.println(fl);
|
||||
// TODO fl の値を出力してください
|
||||
|
||||
}
|
||||
|
||||
@@ -6,10 +6,38 @@
|
||||
*/
|
||||
public class PTra01_09 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// String string;
|
||||
// int number;
|
||||
// char cha;
|
||||
// double doubl;
|
||||
// Boolean bool;
|
||||
byte byte1;
|
||||
short short1;
|
||||
int int1;
|
||||
long long1;
|
||||
float float1;
|
||||
double double1;
|
||||
char char1;
|
||||
boolean boolean1;
|
||||
// TODO 基本型8種類の変数を宣言します(変数名は自分できめてOKです)
|
||||
|
||||
byte1 = 100;
|
||||
short1 = 30000;
|
||||
int1 = 101;
|
||||
long1 = 1011;
|
||||
float1 = 10111;
|
||||
double1 = 1012;
|
||||
char1 = 10121;
|
||||
boolean1 = true;
|
||||
// TODO 宣言した変数に、値を代入してください(代入する値はなんでもOKです)
|
||||
System.out.println(byte1);
|
||||
System.out.println(short1);
|
||||
System.out.println(int1);
|
||||
System.out.println(long1);
|
||||
System.out.println(float1);
|
||||
System.out.println(double1);
|
||||
System.out.println(char1);
|
||||
System.out.println(boolean1);
|
||||
|
||||
|
||||
// TODO それぞれの変数の中身を出力してください
|
||||
|
||||
|
||||
Reference in New Issue
Block a user