Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

夜子まま塾講義2(javaのクラスとメソッド)

916 views

Published on

Javaのクラスとメソッドとフィールドの説明とその使い方の解説

Published in: Technology, News & Politics
  • Be the first to comment

夜子まま塾講義2(javaのクラスとメソッド)

  1. 1. Now Loading. Please Wait ... Re:Kayo-System Co.,Ltd.2012 2 21
  2. 2. Re:Kayo-System Co.,Ltd.2012 2 21
  3. 3. Re:Kayo-System Co.,Ltd.2012 2 21
  4. 4. package ykmjuku.sample.app; public class HelloMain { public static void main(String[] args) { System.out.println("Hello World"); } } Re:Kayo-System Co.,Ltd.2012 2 21
  5. 5. Re:Kayo-System Co.,Ltd.2012 2 21
  6. 6. Re:Kayo-System Co.,Ltd.2012 2 21
  7. 7. package ykmjuku.sample.app; public class HelloMain { public static void main(String[] args) { System.out.println("Hello World"); } } Re:Kayo-System Co.,Ltd.2012 2 21
  8. 8. Re:Kayo-System Co.,Ltd.2012 2 21
  9. 9. Re:Kayo-System Co.,Ltd.2012 2 21
  10. 10. package ykmjuku.sample.app; package ykmjuku.sample.app; public class Hoge { public class HelloMain { public static void main(String[] args) { } Hoge hoge = new Hoge(); } } Re:Kayo-System Co.,Ltd.2012 2 21
  11. 11. package ykmjuku.sample.app; public class Hoge { } package ykmjuku.sample.app; public class Hoge { public Hoge(int n){ } } Hoge hoge = new Hoge(); Re:Kayo-System Co.,Ltd.2012 2 21
  12. 12. Re:Kayo-System Co.,Ltd.2012 2 21
  13. 13. package ykmjuku.sample.app; public class Hoge { class MyClass { } public class HelloMain { } public static void main(String[] args) { Hoge hoge = new Hoge(); Hoge.MyClass c = new Hoge.MyClass(); } } Re:Kayo-System Co.,Ltd.2012 2 21
  14. 14. package ykmjuku.sample.app; public class HelloMain { public static void main(String[] args) { System.out.println("Hello World"); } } Re:Kayo-System Co.,Ltd.2012 2 21
  15. 15. package ykmjuku.sample.app; import ykmjuku.sample.app2.Fuga; public class HelloMain { public static void main(String[] args) { Hoge hoge = new Hoge(); Fuga fuga = new Fuga(); } } Re:Kayo-System Co.,Ltd.2012 2 21
  16. 16. package ykmjuku.sample.app; public class HelloMain { public static void main(String[] args) { Hoge hoge = new Hoge(); ykmjuku.sample.app2.Fuga fuga = new ykmjuku.sample.app2.Fuga(); } } Re:Kayo-System Co.,Ltd.2012 2 21
  17. 17. Re:Kayo-System Co.,Ltd.2012 2 21
  18. 18. Re:Kayo-System Co.,Ltd.2012 2 21
  19. 19. package ykmjuku.sample.app; public class HelloMain { public static void main(String[] args) { System.out.println("Hello World"); } } Re:Kayo-System Co.,Ltd.2012 2 21
  20. 20. package ykmjuku.sample.app; package ykmjuku.sample.app; public class HelloMain { public class Hoge { public static void main(String[] args) { int hello(){ Hoge hoge = new Hoge(); System.out.println("Hello World"); hoge.hello(); return 0; } } } } Re:Kayo-System Co.,Ltd.2012 2 21
  21. 21. Re:Kayo-System Co.,Ltd.2012 2 21
  22. 22. package ykmjuku.sample.app; package ykmjuku.sample.app; public class Hoge { public class HelloMain { void hello(){ public static void main(String[] args) { System.out.println("Hello World"); Hoge hoge = new Hoge(); } hoge.hello(); static void hello2(){ System.out.println("Hello World"); Hoge.hello2(); } } } } Re:Kayo-System Co.,Ltd.2012 2 21
  23. 23. Re:Kayo-System Co.,Ltd.2012 2 21
  24. 24. Re:Kayo-System Co.,Ltd.2012 2 21
  25. 25. package ykmjuku.sample.app; package ykmjuku.sample.app; public class HelloMain { public class Hoge { public static void main(String[] args) { int mCount; Hoge hoge = new Hoge(); System.out.println("1 "); void print(){ System.out.println(mCount); hoge.print(); } hoge.countUp(); System.out.println("2 "); void countUp(){ hoge.print(); mCount = mCount + 1; } } } } 1 0 2 1 Re:Kayo-System Co.,Ltd.2012 2 21
  26. 26. Re:Kayo-System Co.,Ltd.2012 2 21
  27. 27. package ykmjuku.sample.app2; public class Fuga { public class MyClass { void println(){ this.hello(); } void hello(){ System.out.println("MyClass Hello"); } } void hello(){ System.out.println("Fuga Hello"); } public void func(){ new MyClass().println(); } } Re:Kayo-System Co.,Ltd.2012 2 21
  28. 28. Re:Kayo-System Co.,Ltd.2012 2 21
  29. 29. Re:Kayo-System Co.,Ltd.2012 2 21

×