-
Notifications
You must be signed in to change notification settings - Fork 0
Java SE Home
Java Standard Edition(SE) Home
Eager vs Lazy Stream Operations
In the Streams API, operations that return a stream are lazy, and operations that return a non-stream result (or return no result, such as forEach()) are eager.
Local classes are classes that are defined in a block, which is a group of zero or more statements between balanced braces. Typically local classes are defined in the body of a method.
Local class can be defined inside any block (see Expressions, Statements, and Blocks for more information).
Static initializers or member interfaces can not be declared in a local class. But a local class can have static members provided that they are constant variables.
Anonymous classes are local classes without names. Use anonymous class if a local is used only once.