Java_01 basic data types and reference data types

Java basic data types and reference data types

type of data
One: basic data type (stack):
sometimes the code is very simple, that is, add and subtract some numbers; sometimes it is a complex function call, then the "stack" is drawn, and various call parameters are put on the stack Get out of the stack. We just assign the value.
Stack
Two: Reference data type (heap):
Sometimes a little memory will be dynamically allocated, at this time my "heap" will show its talent.
Reference type complexes generally create objects through the new keyword, and then assign this object to the corresponding variable. The most commonly used reference type is the String type, which is also special. You can directly create an object through the keyword new, or you can directly assign a value through a string, such as:
String str = new String ();
str = "abc";
Reference data type

Published 20 original articles · Like1 · Visits 371

Guess you like

Origin blog.csdn.net/songteng2012/article/details/105684255