this week is still learning about interfaces, but learning lambda expressions makes blocks of code more concise.
Lambda form -up is essentially an anonymous method. As the following example:
public int Add (int x, int y) {
return x + y; }
This looks like this after turning into a lambda expression: (int x, int y), x + y;
Parameter types can also be omitted, and the Java compiler is inferred from the context:
(x, y), x + y; Returns the sum of two numbers
or (x, y), {return x + y;}//explicitly indicate the return value
A visible lambda expression consists of three parts: A parameter list, an arrow (-), and an expression or a block of statements.
Internal classes are also a focus of learning, inner classes are mainly members of inner class, local inner class, Anonymous inner class
and static internal classes. Inner classes can directly access members of external classes, including private members, but the inner class
Can not be accessed directly by the external class. Anonymous inner classes are the only classes that do not have constructors . It is because it has no structure
The use of anonymous internal classes is very limited, and most anonymous internal classes are used for interface callbacks. In-part
A class cannot be declared with public or private access modifiers, and its scope is limited to declaring this local
In the block.
This week the Knowledge point mastery is more solid, through the experiment unifies the knowledge point, may deepen the understanding, causes the text not only to stay
On the surface, you can understand its actual value.
201671010138 2016-2017-2 "Java Programming learning experience"