Last active
April 2, 2016 15:23
-
-
Save amippy/ec7c52dc08207905db20c44fa911ce34 to your computer and use it in GitHub Desktop.
筋トレ大好きな文系女学生のJava入門〜クラス定義とオブジェクト生成①〜 ref: http://qiita.com/amippy/items/142165defc2d1fa3cbc8
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 Main { | |
2 public static void main(String[] args) { | |
3 Muscle m = new Muscle(); | |
4 m.name = "腹筋"; | |
5 System.out.println(m.name); | |
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 Main { | |
2 public static void main(String[] args) { | |
3 //※ | |
4 } | |
5 } | |
6 class Muscle { | |
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
1 public class クラス名 { | |
2 public コンストラクタ名() { | |
3 //ここにインスタンス生成処理を記述 | |
4 } | |
5 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment