Key words are: objects.
Java is an object-oriented programming process in which everything is an object in Java, so why design it?
Oop object-oriented programming: This is a faster and cheaper development and maintenance process for managers, and designers are simple to model and clear, so that we need image thinking when we think about objects. The
Object is an abstract description, or it can be said that everything is an object in Java. In fact, the object is only his reference, with new is not to create an object, but to create a reference to the object, when the object is created in a scope with new, the scope of the reference is the curly brace, but the reference point of the type object is still in memory space, but Java with a self-service garbage collection mechanism, Cleans up when the object is no longer in use, which is where Java takes precedence over other areas, avoiding memory leaks caused by the inability to clean up memory in a timely manner. The
object is stored in the following:
Register (fastest storage, in the middle of the processor, but limited in number);
Heap (a common memory pool, also in RAM, no longer need to be created before you know the specific life cycle, when an object is needed, When the program executes to new, the storage allocation in the heap is flexible, all of which may take longer to clean up the memory; the
Stack (random access memory in general RAM, can be supported by a stack pointer, the pointer down is to add new memory, the pointer is free of memory , this is a quick way to allocate memory, second only to registers, but when you create a program, you must know the life cycle and type of all objects stored in the stack, the limitations of the
Constant storage (internal to the program code),
Non-RAM storage (outside of the program, Uncontrolled, such as stream objects and persisted objects;
has default values for basic types or new objects, and Java avoids many errors and initializes functionality.
See Java programming Ideas the previous two chapters summary