S1/using Java to understand program logic/01-first knowledge of Java

Source: Internet
Author: User

The instructions to be issued are described in the Java language, which is the programming process. Usually, people call this file a source or source code,Myprogram.java is a source program. Just as Word documents use . doc as the extension, theJava source program file uses . Java as the extension.

After the compiler's translation, the output is a file with a . class extension called a bytecode file, andMyprogram.class is a bytecode file.

Escape characters:

1,"\ n", moves the cursor to the first pane of the next line, that is, line break.

2,"\ T", moves the cursor to the next horizontal indicator's position (a tab stop equals 8 spaces).

notes for Java and programs:

1, single-line comment:"//"

2.Multi-line Comment:"/*-----*/"

Coding specification:

The class name must be decorated with public .

Only one statement is written on a single line.

the parts enclosed in {} usually represent a hierarchy of the program. the "{" is usually placed at the bottom of the start line of the structure, and"}" is aligned with the first letter of the structure and takes up a separate line.

A lower level of statement or comment should be more than a level of statements or comments indented a number of spaces before writing, is the program more clear, increase the readability of the program.

Note: In the myeclipse project, theJava source file is placed in the src directory, and the compiled file with the . class extension is placed in the bin directory.

Conclusion:

1. The name of theclass that is modified by the public must be the same as the Java file.

2. The void in the main () method is not limited.

3,Java is sensitive to case.

4.in Java , a complete statement has to be ";" end.

5, the output string must be enclosed in quotation marks, and must be in English quotation marks.

S1/using Java to understand program logic/01-first knowledge of Java

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.