Summary of the second chapter

Source: Internet
Author: User

True in Java, false, NULL is not a keyword

There are 11 types of data in Java, eight of which are basic types, others are reference types

Integer byte (1) short (2) int (4) long (8)

Float type float (4) Doubie (8)

Character Char (2)

Boolean Boolcan (indeterminate, determined by the JVM)

Variable: variable fame (short_x) (int_age) (float_salary)

Data type + variable name = initial value

Perform automatic type conversions from low precision to high precision

Bytr<short<int<long<fioat<double

Big turn small to strengthen the system ()

Boolean: Boolean can only contain true and false

Character type: Single quotation mark for character literal, column as ' A '

String: Java has a class named Sting that represents a string object

Any object in Java can be converted to a Sting object

Constants: final+ data type + constant = constant

The inside of a Java Virtual machine consists of (a class loader) (runtime data area) (The execution engine)

Java virtual machines have a method area and a Java heap

Operator: symbol in front, first count after use. After the symbol is used, use it first.

+ = a+=b a=a+b%= a%=b a=a%b y=x++; x=5; Y=6

% (modulo) in addition to the remainder of this number 5%3=2 10%2=0

Shift Operator: Shift Left (") multiplied by 2 n Power shifted right (") divided by 2 n power

3 "5;3*2*2*2*2*2 40" 3; 40/2/2/2

Boolean operator;&& | | These two operators will short-circuit the first false, and the second will not be computed

& | No short circuit, two of them are counted.

^ different or the same is false, the difference is true ~ non-~0=-1 take the opposite number minus 1

Trinocular operation: 1? Represents 2:3

Expression 1 was established into the expression 2, will not enter the representation 3

Indicates that 1 does not enter the representation 3, does not enter the representation 2

Java Comment: (single-line comment) (multiline comment) (Javadoc comment)

Summary of the second chapter

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.