1, the development of Java Program 3 steps: Edit, compile, run.
Edit: stored as text, suffix. java;
Compile: Generate an executable. class file;
Javac Programname.java
Run: Terminal window input
Java programname
2. Error message: Compile error, run-time error, logic error.
3. Command line Parameters
The program can accept command-line arguments, the first command-line argument is args[0], the second is args[1], ...
Java and C language, counting starting from 0;
In C language, the number of command line arguments argc, command line parameters argv;
The function prototype is
int Main (intchar *argv);
4. For loop in Java is different from C language
The C language needs to define variables (if needed) at the beginning of the code block that the curly braces mark, and the Java language is not limited by this.
for (int i = 0; i < num; i++) // Java
5, System.out.print () and System.out.println () difference: the latter after printing the line.
"Getting Started with Java" Hello World