Java Review (i)

Source: Internet
Author: User

Java Development Environment Building

1. Download JDK

2. Environment variable Configuration

3. Enter Java-version in DOS

Java Run process

Source file: Write source file, suffix. java

Compile: Compile the source file into a bytecode file with a. class suffix.

Run: Run a bytecode file with the interpreter

The first Java program

Output Hello world!

 Public class Hello {    publicstaticvoid  main (string[] args) {        System.out.println ( "Hello world!" );    }}

Output:

Key words

Identifier

1, can only be composed of numbers, letters, $, _

2. Cannot start with a number, first letter, case-sensitive

Data types and Constants

Constants: The amount of unchanging data

5: Integer Constants

True: Boolean Constants

5, 5: floating-point constants

S: Character constants

Binary, octal, decimal, hexadecimal

Binary: Digital start plus 0B

Octal: Number start plus 0

Decimal: No need to add

Hex: Number starts with 0X

Comments

Single-line Comment://

Multiline Comment:/* */

Document Comment:/**/

Java Review (i)

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.