q8-9まで完了

This commit is contained in:
2026-09-11 13:32:46 +09:00
parent d705f3d6ee
commit 2b2555f8e7
2 changed files with 33 additions and 5 deletions

View File

@@ -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 の値を出力してください
}

View File

@@ -6,10 +6,38 @@
*/
public class PTra01_09 {
public static void main(String[] args) {
// TODO 基本型8種類の変数を宣言します(変数名は自分できめてOKです)
// 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 それぞれの変数の中身を出力してください