Skip to content

Instantly share code, notes, and snippets.

@amippy
Last active April 2, 2016 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amippy/ec7c52dc08207905db20c44fa911ce34 to your computer and use it in GitHub Desktop.
Save amippy/ec7c52dc08207905db20c44fa911ce34 to your computer and use it in GitHub Desktop.
筋トレ大好きな文系女学生のJava入門〜クラス定義とオブジェクト生成①〜 ref: http://qiita.com/amippy/items/142165defc2d1fa3cbc8
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 }
1 public class Main {
2 public static void main(String[] args) {
3 //※
4 }
5 }
6 class Muscle {
7 //クラス内の定義
8 }
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