201671010146 2017-2 <java Eighth Week sentiment >

Source: Internet
Author: User
Tags class definition

this week, after reviewing the interface, I learned about the use of internal classes.

An inner class is a class that is defined inside another class, and the outer class is called an outer class, and after learning the inner class, think about why you should learn the inner class, for three reasons:

1), the inner class method can access data in the scope where the class definition resides, including private data.

2), inner classes can be hidden and not seen by other classes in the same package.

3), if you want to define a callback function and do not want to write a lot of code, use anonymous internal analogy convenient.

The teacher in this part, listen to listen is also can, is to write code when feel not to know, the teacher with us to write once again, think can also, oneself write time and stuck, or to continue to accumulate the ability to write code.

201671010146 2017-2 <java Eighth Week sentiment >

Related Article

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.