"Java"--Object oriented

Source: Internet
Author: User

Now in the soft exam preparation period, tense and orderly, the first stage of J2SE study, almost one weeks of time, horse soldiers teacher j2se, there is a sense of brief encounter. Ma teacher not only can speak JAVA humorous, easy to understand, but also in learning methods to guide us, long drought every rain feeling is very good!

After the study, the object-oriented part of the resonance is still relatively large. reason : First, before the vb.net, C #, VB, and it has many similarities; second, after the design pattern, look at the object-oriented, understanding more three-dimensional.

Here is my summary of this section:

  

  Language Foundation and Structure and VB very similar, as to object-oriented features, VB is based on objects, does not support overloading, interfaces, inheritance, etc., Java is a purely object-oriented language, support these object-oriented features.

  An important point of object-oriented design is abstraction . Have to mention interfaces and abstract classes . Interfaces can only define methods and constants, but not the implementation of variables and methods, it is a special kind of abstract class. With abstract classes, the subclass types that inherit this abstract class are relatively single, because subclasses can only inherit abstract classes , whereas subclasses can implement multiple interfaces at the same time because the types are more numerous.

Java interfaces and Java abstract classes exist to be used for the implementation and inheritance of specific classes, and if you are going to write a specific class to inherit another specific class, then your design has a big problem. Java abstract classes exist for inheritance, and its abstract approach is to force subclasses to be rewritten.

Here is another point, particularly important, is the memory analysis , this part if you understand, after the interview in China is no problem.

stack: A parameter that is used to store local variables, parameters, which define function names and function bodies , to receive arguments passed when the function is called , and arguments ( the arguments passed to the function when called, that is, the value passed to the called function . For the memory of the stack, once the method is called, the memory disappears immediately.

Heap: The object that holds new, the member variable. When the heap's memory usage is complete, it is not immediately gone, and when no reference is directed to the object in the heap, the garbage collector comes and gracefully removes it.

data area: static variables (belonging to the entire class, non-private) stored here, only one copy, string constants are also stored here.

Code Area: store code.


Java is an object-oriented language. The Java virtual machine allows the language to have a compilation, multi-platform operation of the ultra-strong adaptability, garbage collection mechanism , so that the computer's memory has been more fully utilized. How can a language that absorbs the essence of C + + language and its meal, not let the public like it? The Java road has just begun, expecting to meet again after the soft exam.

Summary is very simple, still hope to correct!



"Java"--Object oriented

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.