When writing Java programs, you should pay attention to the following points:
1. Case sensitivity
Java is case sensitive, which means The identifier Hello is different from hello.
2. Class name
For all classes, the first letter of the class name should be capitalized. If the class name consists of several words, the first letter of each word should be capitalized, for example, MyFirstJavaClass.
(Video tutorial recommendation: java video)
3. Method name
All method names should start with a lowercase letter. If the method name contains several words, the first letter of each subsequent word is capitalized.
4. Source file name
The source file name must be the same as the class name. When saving the file, you should use the class name as the filename (remember Java is case-sensitive) and the filename suffix .java. (If the file name and class name are different, a compilation error will occur).
5. Main method entrance
All Java programs start execution from the public static void main(String []args) method.
Recommended tutorial: Getting started with java development
The above is the detailed content of What issues need to be paid attention to when writing java programs. For more information, please follow other related articles on the PHP Chinese website!