Posts

Showing posts with the label Java 11

All advanced sorting techniques using Java 8 and Streams

package com.dpq.interview.Q; import java.math.BigInteger; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.List; public class SortingDemo { public static void main(String[] args) throws ParseException { allSortingTechniquesAfterJava8(); } public static void allSortingTechniquesAfterJava8() throws ParseException { List<Employee> list = populateList(); System.out.println(“####################################### Natiral soring by Employee Id ###############################################”); list.stream().sorted().forEach(e -> System.out.println(e)); System.out.println(“####################################### Natiral soring by Employee Id but in desending order ###############################################”); list.stream().sorted(Collections.reverseOrder()).forEach(e -> System.out.println(e)); List<Employee> sortedList = list

Java 11 Features

Why is Java 11 important? Which JDK build should I download and what are the benefits of each of them? How to download Java 11 Free Version? Java 11 Features: Running Java File with single command Java String Methods Local-Variable Syntax for Lambda Parameters Nested Based Access Control JEP 309: Dynamic Class-File Constants JEP 318: Epsilon: A No-Op Garbage Collector JEP 320: Remove the Java EE and CORBA Modules JEP 328: Flight Recorder JEP 321: HTTP Client Reading/Writing Strings to and from the Files JEP 329: ChaCha20 and Poly1305 Cryptographic Algorithms JEP 315: Improve Aarch64 Intrinsics JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)  JEP 335: Deprecate the Nashorn JavaScript Engine Conclusion