Java By Sun Microsystems The company was founded on 1995 year 5 High level programming language launched in June .
Java Can run on multiple platforms , as Windows, Mac OS And many other UNIX Version of the system .
This tutorial will give you a better understanding of Java programing language .
Mobile operating system Android Most of the code uses Java Programming language programming .
My first JAVA Program
Let's use a simple example to show Java Programming , Create file HelloWorld.java( The file name must be consistent with the class name ), The code is as follows ：
Run instance »
notes ：String args And String args Can execute , But... Is recommended String args, This can avoid ambiguity and Misreading .
Run the above example , The output results are as follows ：
$ javac HelloWorld.java $ java HelloWorld Hello World
Execute command parsing ：
We used two commands above javac and java.
javac Followed by java File name of the file , For example HelloWorld.java. This command is used to convert java The source file is compiled as class Bytecode file , as ： javac HelloWorld.java.
function javac After the command , If the compilation is successful and there are no errors , There will be a HelloWorld.class My files .
java Followed by java Class name in file , For example HelloWorld Is the class name , as : java HelloWorld.
be careful ：java Don't add... After the command .class.
Gif Figure shows ：