Knowledge Point Grooming

Source: Internet
Author: User

After learning the basics this week, we entered a new stage of learning and learned more about new knowledge. To make a summary.

Private provides us with the concept of encapsulation, and provides the public method for us to access and modify methods and properties, so that not only can restrict the modification of certain properties of access, but also the internal layer of the property method of a certain split assembly to achieve a cryptographic effect. Encapsulation is a broad concept, and it is also called a wrapper to write the methods and properties in the same class.

Statically modified methods and member variables we call static member variables, which are characterized by the existence of a data region, and all objects share a copy, if an object call changes its value, the other object call value is also changed values; static loads with the load of the class, which takes precedence over the existence of the object. Therefore, the This keyword cannot be used in its methods because it can only access static members.

The static initialization block is also the same, loaded as the class is loaded, used to initialize the class, and is called only once, and the new object is no longer called.

Instantiating an initialization block is different, it is executed once every time the object of the class is instantiated, and it executes before the constructor call.

In addition, we have learned the concept of an inner class, which is a redefinition of the class within the class. There are four types of Java internal classes: Static inner class, member inner class, local inner class, anonymous inner class. In order to write the Java code beautifully refined, we must learn the use of internal classes, at present we only require the mastery of naming norms, and know what it is a kind of internal class, concrete later strengthening.

Knowledge Point Grooming

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.