01day_java Basic Syntax

Source: Internet
Author: User

1. Java Development Environment Overview

Jdk:java Development Kit (Java Development Kit), including Java compilers, Java Runtime Environments, and commonly used class libraries;

Jre:java Runtime Environment (Java Runtime Environment).

2. Cross-platform features

① platform refers to the operating system (WINDOWS,LINUX,MAC)

②java programs can be run on any operating system, once written and run everywhere

③ implementing a Java-dependent virtual machine JVM for cross-platform use (Java virtual machines)

3. Setting of Environment variables

JAVA_HOME:JDK Path

Path: Add%java_home%\bin;

Input JAVAC-VERIOSN Test succeeded

4. Successfully compiled and run, output Hello world!

5. Use Advanced Notepad notepad++

6. Comments

Role: Explanatory notes, easy to read

Single-line Comment://I am a comment

Multiline Comment:/* I am comment */

Document Comments:/** comments */

7. Key words

The keywords in Java are lowercase

8. Identifiers

Composition rules: Letters 52 A-Z, a-Z, number 0-9, underscore (_), dollar sign ($), cannot start with a number, cannot be a keyword

Class Name: First Capital, first letter of the second word

Method Name: First letter lowercase, each word capitalized

9. Data

program = data + logic

Data type: base data type, reference data type (array, class, interface)

10. Constants

Integer type:

Decimal: The numbers that are often in life

Binary: Start with 0b, such as 0b1001;

Hex: Starting with 0x, the number is composed of 0-9 and a-f, such as 0xa;

Octal: Starting with 0, such as 07

Decimal type:

such as 1.0

Boolean type:

True, False

Character type:

Characters must be enclosed in single quotes and can contain only one character;

String constants:

String type is a reference type and must be wrapped in double quotation marks, which can contain 0-n characters.

01day_java Basic Syntax

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.