Introduction to new things in java 8.
Use link to see example of relevant title.
Lambda expression is nothing but an anonymous function.
Functional Interface is an Interface having only one abstract method.
Default static method method with default static and defined in an interface.
java.util.function.*
java.util.function.Predicate
java.util.function.Consumer
list.forEach(p -> Person::getInfo)
list.forEach(p -> personObject::getInfo)
Way to deal with null value.
java.util.Optional.of(new Person(23, "Sumit"))
forEach(Consumer con) method added to collection
Traveling and aggregating collection sequentially.
new ArrayList(). stream()
Traveling and aggregating collection parallel.
new ArrayList(). parallelStream()
//The Classes
java.util.Instance
java.util.Duration
java.util.LocalTime
java.util.LocalDate
java.util.LocalDateTime
java.util.DateTimeFormatter
java.util.DateTimeFormatterBuilder
Dealing with time and date without time zone information.
How for format date and time using DateTimeFormatter ?
Date and Time with zone information.
//nashorn command line using jjs
Sumits-MacBook-Air:~ sumit$ jjs
jjs> var welcome = 'Welcome to Nashorn';
jjs> welcome
How execute javscript file using nashorn ?
Adding delimiter between string. join() static method on string.
Joining using java.util.StringJoiner class. We can add delimiter, prefix, suffix