"Java" java_04 HelloWorld Promotion

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.