Primitive types in Java (Primitive Types) and reference types (Reference Values)

Source: Internet
Author: User

There are two types of Java virtual machines that can be handled, one is the original type (Primitive Types) and one is the reference type (Reference Types).

Correspondingly, there are two types of values that have primitive values (Primitive values) and reference values (Reference values) that can be used for variable assignment, parameter passing, method return, and operation.

Primitive type and value

The original data types supported by the Java Virtual machine include numeric types, Boolean types, and ReturnAddress types.

Numeric types include: integer types and floating-point types.

Integer types include:

1, byte

2. Short

3, int

4, long

5, Char

Floating-point types:

1, float

2, double

Boolean Type: Boolean

ReturnAddress type: An opcode (Opcode) that represents a bytecode instruction. Of all the primitive types supported by the virtual machine, only the returnaddress type cannot correspond directly to the data type of the Java language.

Reference type and value

There are three types of reference in a Java Virtual machine: Class Types, array type (Types), and interface type (Interface Types).

The values of these reference types are dynamically created by class instances, array instances, and class instances or array instances that implement an interface, respectively. The default value for a reference type is null.

Primitive types in Java (Primitive Types) and reference types (Reference Values)

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.