Java Basic data types

Source: Internet
Author: User
Tags float double

Javadata type This place will be frequently asked when interviewing, many people do not pay attention to this problem, today to bring you a comprehensive understanding.
Javadata types are mainly divided into:1.Basic data Types2.Reference Data Type3.empty types are described below.

Basic data types include:Byte,short,int,long,char,float,double,booleanTotal8Note: Non-precision storage of floating-point data, integer data for accurate storage. The literal value of the data type has default values: integer type isint, Real type: forDouble

Reference types (also called object types) have5types: Classes, interfaces, arrays, enumerations, callouts

Empty type:void

8the basic types of wrapper classes in:Byte Short Integer Long Character Float Double Boolean
Basic types of advantages: The data storage is relatively simple, the operation efficiency is high.
Packaging class Advantages: Some easy, such as the set of elements must be object type, satisfies theJavaEverything is the thought of the object.

Reference type: The underlying structure and basic types differ greatly
First introduce the followingJVMof memory space:
1. HeapHeap Space: assigning objectsNew Person()
2. Stackstack space: temporary variablePerson per
3.CodeCode Area: class definition, static resourcePerson.class

For example:
Person per = new person();//newcreating objects in the heap space of memory,assign the address of the object toperReference Variable
Per.name ();

The above example implements the steps:
1.JVMLoadingPerson.classto theCodeArea
2.new person ()allocate space in the heap space and create a PersonExample
6.Kassigns the address of this instance to a referenceper, Stack space

If there is an error, please testify,thx

More information: www.kootest.com; Technology Exchange Group: 182526995

Java Basic data types

Related Article

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.