First, the object
For each language, there are ways to manipulate the elements in memory.
In Java, everything is treated as an object. But manipulating the object is a "reference". For example, can be compared to the remote control of the operation of the TV, the remote control is a reference, and TV for the object.
References can be created, such as String s, but not initialized and cannot be used. In the use of the process, to error.
Second, create the object
In Java, there are a number of types available, and we can create types ourselves.
Once you have the type, we can use new to create the object.
1. Where are the objects stored?
There are five places where data can be stored. Registers, stacks, heaps, constant storage, non-RAM storage.
The objects we create are stored in the heap.
2. Basic type
The base type differs from the object. They are not objects of reference. Instead, the value is stored directly on the stack.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java Programming Ideas---objects