First knowledge of java:1

Source: Internet
Author: User

One: initial Java

1: Outer frame:

Class name After class must be the same as the file name

Naming method: 1) Composition can only have _ $ alphanumeric

2) numbers cannot begin

3) First letter must be capitalized

4) See the meaning of the name

2, Inner frame

2.main method

A class method has only one main method entry

3, Output statement

Println means to end this sentence after the line, can not add, write as print;

The contents of the output in parentheses are enclosed in double quotation marks;

A semicolon must be added at the end of sentence;

Second, the complete HelloWorld

The output of the console is

Three, escape character

1,\n the meaning of a newline,

Example:

2,\t An empty tab is equivalent to tab

Example:

Four, using CMD to compile the execution

1, build notepad, change suffix name Helloworld.java

2, write content

3, compile the Javac file name. java

4, execute Java file name

Exam NOTES:

    1. Java is the launch of the Sun company.
    2. Single-line comment//, multiline comment/* */.
    3. The class name must be decorated with public.
    4. Only one statement is written on a single line.
    5. System,string first letter S must be capitalized.

First knowledge of java:1

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.