SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
9.
Java版Hello World
// おまじないとして進めざるを得ない項目が多い
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
10.
Java版Hello Worldのおまじない (1)
// クラス
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
11.
Java版Hello Worldのおまじない (2)
// メソッド
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
12.
Java版Hello Worldのおまじない (3)
// アクセス修飾子
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
13.
Java版Hello Worldのおまじない (4)
// 静的(メソッド)
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
14.
Java版Hello Worldのおまじない (5)
// 戻り値
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
15.
Java版Hello Worldのおまじない (6)
// 引数
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
16.
Java版Hello Worldのおまじない (7)
// 配列(もしくは可変長引数)
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
17.
Java版Hello Worldのおまじない (8)
// パッケージ
public class HelloWorld {
public static void main(String[] args) {
System.out.println("エリチカ、おうちに帰る!");
}
}