Java Data types

Source: Internet
Author: User

Data type: 1): Basic data type: Byte, short, int, long, float, double, char, Boolean

2): Reference data type: Array, class, interface.

Level from low to High: Byte,char,short (these three levels)-->int-->float-->long-->double

Automatic type conversion: from low to high level, the system automatically turn;
Coercion type conversions: What is the use of?

Assign a high-level number to a variable with a low rank for that number;

Operation symbol: 1), arithmetic operator.
+-*/%: Any integer modulus 2 is not 0 is 1, so as long as the change is the module can be implemented switch operation.   +: Connector. ++,--

2), assignment operator.
=  += -= *= /= %=

3), comparison operator.
Features: This operator is characterized by the result of the operation, either True or false. 4), logical operator.
& |   ^  ! && | |
Logical operator except!   are used to concatenate two Boolean expressions. &: Only both sides are true and the result is true. Otherwise it is false. |: If both sides are false the result is false, otherwise it is true ^: xor: And or a little different.
On both sides, the result is false.

It is true that the results are different on both sides.

& and && difference: &: Whatever the left result is, the right side is involved in the operation.
&&: Short-circuit and, if the left is false, then the right-hand parameter and operation. | and | | Difference: |: Both sides are calculated.
||  : Short circuit or, if the left is true, then the right side does not participate in the operation.   5), bitwise operator: operator used to manipulate bits.  & | ^
<< >> >>> (unsigned Right shift)

Java Data types

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.