Summary and promotion of HelloWorld
1.Java is case sensitive and the program cannot run if there is a case spelling error
2. The keyword public is referred to as the access modifier (access modifier), which is used for other parts of the control program to access the code.
3. The keyword class indicates that all content in a Java program is contained in a class, and Java is a purely object-oriented language
4. a source file can have at most one public class declaration, the number of other classes are unlimited, if the source file contains a public class, the source filename must be the same as the class name of the public defined in it, and with "Java" as the extension.
5. a source file can have more than one class
6. properly compiled source files, will be the corresponding bytecode files, the compiler generates a separate bytecode file for each class, and the bytecode file is automatically named class name and "class" as the extension
The 7.main method is an entry method for a Java application that has a fixed writing format:
public static void Main (string[] args) {...}
8. in Java, using curly braces to separate parts of a program, the code for any method must start with "{" and End With "}", so the curly brace style is unrestricted because the compiler ignores spaces
Each statement in 9.Java must end with a semicolon, and the carriage return is not the end flag of the statement, so a statement can span multiple lines
Ten. Programming Style :
1. pay attention to indent !
2. programming in Pairs !
Notes
A note is a Programmer's explanation for the reader and a means of improving the readability of the program.
in the in Java, there are 2 ways to express comments
single-line comment ---- comment content from // to end of bank
/*
single-line or multiline comment
*/
/ * * * comments cannot be nested
Comments in Java do not appear in bytecode files. That is , the JAVA Compiler skips comment statements when it compiles.
"Java" java_04 HelloWorld Promotion