201671010128 2017-10-08 "Java programming" lambda and internal classes

Source: Internet
Author: User
Tags class definition

First, the basic concept

    1. Java LAMBDA expressions are a new feature introduced in Java 8, and the main purpose is to provide a functional syntax to simplify coding.
    2. A lambda expression is essentially an anonymous method.
    3. Java LAMBDA Expressions use the functional interface as the base of the application.
    4. An inner class (inner class) is a class that is defined inside another class.

Ii. Points of attention

    • There are three reasons for using internal classes:
    1. An inner class method can access the 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. Using anonymous inner classes is convenient when you want to define a callback function and do not want to write a lot of code.
    • An inner class object holds a reference to an external class object that, when a variable is accessed in the member method of the inner class, is not defined in the method and inner class, and the reference to the variable in the inner class is passed to the reference of the outer object.

Third, object-oriented program design course study progress bar

Week (read/write) Number of lines in code Post Blog volume/comment blog number classroom/After School time (hours) Most satisfying programming task
first week 20/7 1/1 6/4 write Hello World program
second week 38/20 1/1 6/5 Experiment two tasks three
third week 50/30 1/1 6/7 experiment three
Fourth week 58/46 1/1 6/5 Edit Write output n digits number, and sum
Fifth week 67/53 1/1 6/6 class definition and overloading
Sixth week 71/60 1/1 6/4 interface
Eighth Week 80/66 1/ 6/3 lamdba expression
...        
Cumulative 384/275 7/6 42/34  

201671010128 2017-10-08 "Java programming" lambda and inner class

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.