Java Junior Development Programmer (Unit II)

Source: Internet
Author: User
Tags arithmetic operators logical operators true true

* Must be back before class. Words to Remember:

Double decimal string character character

Integer integer Scanner scanner score Score

Boolean Boolean type True True False

1. Variable three elements:

①: Variable Type

②: Variable Name

③: Variable Value

Eight types of data commonly used in 2.java

Integer type: int (+) long (+) byte (8) Short (16)

Decimal type: Double (64) Double precision Float (32) Single precision

Character type: Char

Boolean Type: Boolean

3.java-Novo operator

① Arithmetic operators:

+ (plus)-(minus) * (multiply)/(except)% (take the remainder operation)

② logical operators:

< (less than) > (greater than) <= (less than or equal) >= (greater than or equal) = = (equal to) = = (not equal to)! =

③ Relational operators:

&& (dual and) | | (double or) (they both have short-circuit effects) & (with) | (OR)! Non-

④ Assignment operators:

=

4. Data type conversions:

① cast: Is a type from a large storage range to a small storage range.

Example code: Double a=10;

int a1= (int) A;

* Attention Issues:

Forcing type conversions usually stores the loss of precision, so use caution

② Automatic conversion: is a type from a small storage range to a large storage range.

Example code: Double a=10;

int a1=a;

* Attention Issues:
When converting between integers, numeric values do not change, and integer types, especially larger integer types, are converted to decimal types.

Due to different storage methods, there may be loss of data accuracy.

Java Junior Development Programmer (Unit II)

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.