練習問題4-1
int x = 10;
System.out.println(x);
int x = 10;
System.out.println(x);
double y = 3.14;
System.out.println(y);
char c = 'a';
System.out.println(c);
boolean b = true;
System.out.println(b);
String s = "Hello, World!";
System.out.println(s);
int[] numbers = {1, 2, 3, 4, 5};
for (int number : numbers) {
System.out.println(number);
}
double[] data = {1.1, 2.2, 3.3, 4.4, 5.5};
for (double d : data) {
System.out.println(d);
}
char[] characters = {'a', 'b', 'c'};
for (char c : characters) {
System.out.println(c);
}
boolean[] flags = {true, false, true, false, true};
for (boolean flag : flags) {
System.out.println(flag);
}
String[] strings = {"Hello", "Java", "World"};
for (String str : strings) {
System.out.println(str);
}