executed at later Eme • Good riddance to anonymous classes • Makes funcEonal programming much easier • Enables wriEng of clear, concise code • Brings Java into the modern era
of elements supporEng sequenEal and parallel aggregate operaEons • Allows programmers to write a pipeline of filters, conversions, and other operaEons followed by a terminal operaEon
.stream() .filter(s -> s.startsWith("c")) .map(String::toUpperCase) .sorted() .forEach(System.out::println); Transform, sort, and print words starEng with C
.stream() .filter(s -> s.startsWith("c")) .map(s -> s.toUpperCase()) .sorted() .forEach(s -> System.out.println(s)); Transform, sort, and print words starEng with C
They will not execute unEl a terminal operaEon is called • Order of operaEons mafers! • Filter -‐> Map != Map -‐> Filter • Order of elements should not mafer! • Don’t expect elements to be processed in the order added
a Javascript engine • Built to replace Rhino • Can be called from the command line, similar to java or javac Hello.js -‐> print("Hello World!"); $ jjs hello.js -‐> Hello World!
javascript files • This includes libraries like Mustache, Lo-‐ dash, etc • Interact with Java code and types within Javascript • Extend Java classes from Javascript
javascript files • This includes libraries like Mustache, Lo-‐ dash, etc • Interact with Java code and types within Javascript • Extend Java classes from Javascript • A mulEtude of things that should frighten you
implementaEon on an interface • ImplemenEng classes can do 3 things • Do nothing and inherit the default • Re-‐declare the method to make it abstract • Redefine the method to override the behavior
implementaEon on an interface • ImplemenEng classes can do 3 things • Do nothing and inherit the default • Re-‐declare the method to make it abstract • Redefine the method to override the behavior • StaEc methods are also allowed on interfaces
Date/Time API? • Classes like java.uEl.Date were not thread-‐safe • Months start at 1, Days at 0 • Everyone was using Joda-‐Time anyway • So Java stole the good stuff • Immutable-‐value classes • DDD (Domain Driven Design) API
• LocalDateTime is now the base class most programmers will interact with • LocalDateTime, LocalDate, and LocalTime are all disEnct enEEes • TemporalAdjusters make common tasks easy • First or last day of the month • First or last day-‐of-‐week in the month • Next day-‐of-‐week
apply a single annotaEon of a given type • Could work around this by creaEng a wrapper annotaEon • Was quite clunky • RepeaEng AnnotaEons hides the “clunkiness”
it even or slightly ahead of Java 7 • Ater JVM warmup, streams can perform befer than comparable imperaEve code • Lambdas out perform inner classes • The Bad • Parallel streams can kill scalability if you’re not careful • ImperaEve loops are sEll king in some situaEons
can someEmes make stack traces nasty • FuncEonal programming isn’t fully baked • Scala, Groovy, and others sEll do it befer • Performance can be slighty slower if programmers aren’t careful with streams
pulling in the best ideas from the community and catching up to other modern languages • There is a lot of depth to this update. We sEll don’t know what the community will do with it • No single programming paradigm is going to be good enough anymore
Project Jigsaw • Money and Currency API • AutomaEc ParallelizaEon • Java 10 – 2018… • Objects without value types • 64-‐bit addresses for large datasets