Question01完了
This commit is contained in:
6
Question01-StartProgram/.classpath
Normal file
6
Question01-StartProgram/.classpath
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
1
Question01-StartProgram/.gitignore
vendored
Normal file
1
Question01-StartProgram/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/bin/
|
||||
17
Question01-StartProgram/.project
Normal file
17
Question01-StartProgram/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Question01-StartProgram</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -8,6 +8,7 @@ public class PTra01_01 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
//TODO Hello,world と出力してください
|
||||
System.out.print("Hallo,word");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ public class PTra01_02 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO 11行目のコメントを単一行コメントにしてコンパイルエラーが出ないようにしてください
|
||||
ここをコメントアウトする
|
||||
//ここをコメントアウトする
|
||||
|
||||
// TODO 14行目 ~ 16行目を複数行コメントにしてコンパイルエラーが出ないようにしてください
|
||||
/*ここをコメントアウトする
|
||||
ここをコメントアウトする
|
||||
ここをコメントアウトする
|
||||
ここをコメントアウトする
|
||||
ここをコメントアウトする*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ public class PTra01_03 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO 文字列型の変数 str を宣言してください。
|
||||
|
||||
String str;
|
||||
// TODO str に こんにちは を代入してください
|
||||
|
||||
str = "こんにちは";
|
||||
// TODO str の値を出力してください
|
||||
|
||||
System.out.println(str);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class PTra01_04 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO 数値型の変数 number を 10 で初期化してください。
|
||||
|
||||
int number = 10;
|
||||
// TODO number の値を出力してください
|
||||
|
||||
System.out.println(number);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class PTra01_05 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO char型の変数 ch を A で初期化してください。
|
||||
|
||||
char ch = 'A';
|
||||
// TODO ch の値を出力してください
|
||||
|
||||
System.out.println(ch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class PTra01_06 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO boolean型の変数 bo を true で初期化してください。
|
||||
|
||||
boolean bo = true;
|
||||
// TODO bo の値を出力してください
|
||||
|
||||
System.out.println(bo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class PTra01_07 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO long型の変数 lo を 1000000000000 で初期化してください。
|
||||
|
||||
long lo = 1000000000000L;
|
||||
// TODO lo の値を出力してください
|
||||
|
||||
System.out.println(lo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public class PTra01_08 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO float型の変数 fl を 3.14 で初期化してください。
|
||||
|
||||
float fl = 3.14F;
|
||||
// TODO fl の値を出力してください
|
||||
|
||||
System.out.println(fl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,28 @@ public class PTra01_09 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
// TODO 基本型8種類の変数を宣言します(変数名は自分できめてOKです)
|
||||
|
||||
byte a;
|
||||
short b;
|
||||
int c;
|
||||
long d;
|
||||
float e;
|
||||
char f;
|
||||
boolean g;
|
||||
// TODO 宣言した変数に、値を代入してください(代入する値はなんでもOKです)
|
||||
|
||||
a = 1;
|
||||
b = 10;
|
||||
c = 100;
|
||||
d = 1_000l;
|
||||
e = 2f;
|
||||
f = 'j';
|
||||
g = true;
|
||||
// TODO それぞれの変数の中身を出力してください
|
||||
|
||||
System.out.println(a);
|
||||
System.out.println(b);
|
||||
System.out.println(c);
|
||||
System.out.println(d);
|
||||
System.out.println(e);
|
||||
System.out.println(f);
|
||||
System.out.println(g);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user