A summary of the first two chapters of Java programming thought

Source: Internet
Author: User

  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

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.