Tag: java 8 features

JAVA New Features – Stream – Part 3

This blog explains about Stream part 3 in java is given below :  map(Function) map(List of Objects -> List of Objects) Example 2: It should be rewritten as below: limit() skip() total reduce() //Converting ArrayList to Array //Get max from an ArrayList Parallel Stream //ParallelStream //Sorting Based on Key: Alphabetical Order //anyMatch() anyMatch() //allMatch() //noneMatch()

Read More

JAVA Features – Stream API – Part 2

This blog explains about Stream API in java is given below :  Print Array values in Sorted Order: Note: Intermediate Operations are Lazy OperationsTerminal Operations are Eager Operations Find average of elements in an Array: Finding max of given Array: Finding minimum of given Array: Finding First value of given Array: Finding any value of […]

Read More

JAVA Features – Method Reference – Double Colon Operator in Java

This blog explains about Method reference double colon operator in java is given below :  Method Reference: :: Double Colon Operator: Short cut for Lambda Expressions:Code Readability:Compact. Arguments should match in interface method and our class method. We can use Method Reference for static and non-static methods.

Read More

JAVA New Features – Lambda Expressions, Functional Interfaces

This Blog explains about Java 8 – New Features – Lambda Expressions, Functional Interfaces. Lambda Expressions: WHY: Functional Programming WHAT: Anonymous Functions: Closures Function – Method: HOW: Eg: 1 1) Remove Method Name 2) Remove return datatype 3) Remove Access Modifiers if any. 4) Add -> in between () and {} Eg. 2: Eg. 3: […]

Read More