I. Steps to develop Java programs
1). Write the source program (the program ends in. java) the Java source program file uses. java as the extension.
2). Compile (using Java directives to compile the source program, the compiled file ends with a. Class)
3). Run (run the compiled file using Java directives)
Two. Java Program structure
Outer frame public class class name {
} Note: Class name is consistent with file name
Inner frame
public static void Main (string[] args) {
} Note: The method name must be a main comment: 1). The main method is the Java program's entry
2). A program can have only one main () method
three. output directive
System.out.println ("");
System.out.print ("");
NOTE:
1) The system first letter uppercase
2) println output after wrapping
print output only
Four common errors
1) Public-decorated classes must have the same name as the Java file
2) void in Main () method
3) Java is case sensitive
4) in Java, a complete statement is ";" End
5) The string output must be quoted in quotation marks and must be quoted in English
\ n and \ t
\ n line break
\ T tab (four characters is a tab)
Getting started with Java