In the field of development, when learning a programming language, it is customary to welcome the world with its first application. Regardless of the specific environment, the phrase displayed as a result of the Hello World program will be the initial stage for mastering. The following is an example of such a simple Java application.
Preparing to create the first application
Hello World Java, . , , - JDK. . Oracle. Java - 8. .
- IDE, , , Eclipse NetBeans, . - .
Hello World Java
, JDK. Windows gedit nano Linux. , , HelloWorld.java. :
class HelloWorld {
}
. Java , , . , Java, , . , - :
class HelloWorld {
public static void main(String[] args){
}
}
main Java. public - , , . , , .
static, , , . void , main - , - .
String [] , , , . args . , main, , , «» .
:
class HelloWorld {
public static void main(String[] args){
System.out.println(«Hello World!»);
}
}
. . Java . , , .
Hello World Java, . Windows , Linux - . , HelloWorld.java. , Windows C:\Java\Hello. cd C:\Java\Hello. , -. :
javac HelloWorld.java
. :
java HelloWorld.
Hello World Java - .
Java - . - . - Java. Android. , , Java .