Java Data types

Source: Internet
Author: User

。 underlying data type

Data type

Classification

Number of binary digits

Wrapper class

Byte

Numeric type

8

Byte

Short

Numeric type

16

Character

Int

Numeric type

32

Integer

Long

Numeric type

64

Long

Float

Numeric type

32

Float

Double

Numeric type

64

Double

Boolean

1

Boolean

Char

String

16

Character

。 Reference Data Type

Java has 5 reference types (object types): Class interface Array enumeration callouts.

Data type conversion Description:

Underlying data type:

Conversions from strongly typed to weakly typed require casting, and the system automatically transforms from weakly typed to strongly typed conversions. For example, if thedouble type is strongly typed compared to the int type, then the data converted from the double type to the int type will need to be cast , whereas the other is automatically converted. The strength and weakness of the other eight basic data types are as follows:byte<short=char<int<long<float<double, conversion between peers also requires casting

Reference data type:

When a subclass object is converted to a parent class object (including an interface) in a class, the system is automatically converted, called upward transformation, and when the parent class object (including the interface) is converted to the subclass object, a cast is required, called a down-casting.

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.