Last active
February 28, 2016 15:14
-
-
Save amippy/438d14c89f38134c8109 to your computer and use it in GitHub Desktop.
文系大学生のJava入門 ref: http://qiita.com/amippy/items/96e8e725382881b6c9f3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 public class HelloWorld{ | |
2 public static void main(String[] args){ | |
3 System.out.println("MuscleWorld!"); | |
4 } | |
5} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 public class HelloWorld{ | |
2 public static void main(String[] args){ | |
3 int age; | |
4 age = 21; | |
5 System.out.println(age); | |
6 } | |
7 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 public class HelloWorld{ | |
2 public static void main(String[] args){ | |
3 final int AGE = 21; | |
4 System.out.println("私の年齢は"+AGE+"です!"); | |
5 } | |
6 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 public class HelloWorld{ | |
2 public static void main(String[] args){ | |
3 final int AGE = 21; | |
4 System.out.println("私の年齢は"+AGE+"です!"); | |
5 AGE = 18; | |
6 System.out.println("私は"+AGE+"歳に戻りたいです。"); | |
5 } | |
6 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
整数 | |
int : 普通の整数 int age = 20; /*利用頻度が高い*/ | |
long: 大きな整数 | |
short:小さな整数 | |
byte:shortよりさらに小さな整数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
整数 | |
int : 普通の整数 int age = 20; /*利用頻度が高い*/ | |
long: 大きな整数 | |
short:小さな整数 | |
byte:shortよりさらに小さな整数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
少数 | |
double: 普通の少数 /*特別な事情がない限りdoubleを使う*/ | |
float: 少し曖昧でも良い少数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
少数 | |
double: 普通の少数 /*特別な事情がない限りdoubleを使う*/ | |
float: 少し曖昧でも良い少数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
真偽値 | |
boolean: trueかfalse boolean result = true; /*結果は成功という意味*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
真偽値 | |
boolean: trueかfalse boolean result = true; /*結果は成功という意味*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
文字 | |
char : 一文字 「''」で表現 char gender; = '女' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
文字 | |
char : 一文字 「''」で表現 char gender; = '女' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
文字列 | |
String : 文字の並び 「""」で表現 String name; = "筋トレ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
文字列 | |
String : 文字の並び 「""」で表現 String name; = "筋トレ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
変数の初期化 | |
型 変数名 = 代入するデータ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 public class HelloWorld{ | |
2 public static void main(String[] args){ | |
3 int age = 21; | |
4 System.out.println("私は"+age+"歳です!"); | |
5 age = 22; | |
6 System.out.println("今年で"+age+"歳になります!"); | |
7 } | |
8 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
【定数の宣言方法】 | |
final 型 定数名(大文字) = データ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 public class HelloWorld{ | |
2 public static void main(String[] args){ | |
3 final int AGE = 21; | |
4 System.out.println("私の年齢は"+AGE+"です!"); | |
5 AGE = 18; | |
6 System.out.println("私は"+AGE+"歳に戻りたいです。"); | |
5 } | |
6 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment