New Features in java
Java 1.5 version:
- · for-each
- · var-args
- · Autoboxing and Unboxing
- · Queue
- · Enum
- Generics
- · Annotations
- · Static Import
- · Covariant return types
Java 1.6 version:
- · NavigableSet
- · NavigableMap
Java 1.7 version:
- · Switch can take String Argument
- · try with resource
- · try with catch where single catch can take multiple Exceptions
- · Enhancements in HashMap.
Java 1.8 version:
- Lambda Expressions
- Java Stream API for collection classes
- Functional Interfaces
- Interface changes with default and static methods
- Predicate, function, consumer ==> Predefined functional interfaces
- Method reference, constructor reference by double colon (::) operator
- Java Date Time API (joda.org==>Joda API)
Adv:
To simplify the programming
To utilize functional programming benifits
To enable parallel programming
Java 1.9 version:
- JShell
- JPMS(Java Platform Module System)
- JLink(Java Linker)==> customise jre==> for Microservices or portablity or mobiles
- Http/2 client API
- Process API Update
- private methods inside Interface
- try with resource enhancements
- Factory Methods to create unmodified collections
- Stream API Enhancements
- <> operator(is applicable to anonymous inner classes)
- SafeVarargs Annotations
- G1 GC(Garbage First Garbage Collector)
Java 10 version:
- var
Java 14 version:
- Switch, yield
days = switch (month) { case JANUARY, MARCH, MAY, JULY, AUGUST, OCTOBER, DECEMBER -> 31;
case JANUARY, MARCH, MAY, JULY, AUGUST, OCTOBER, DECEMBER -> { System.out.println(month); yield 31; }
Java 15 version:
- Text Blocks [""" Write text block """ ]
Java 16 versions:
- Record instead of DTO/ lombok
- Pattern Match
if (v instanceof Car c)
Java 17 versions:
- Sealed Class
public sealed class Vehicle permits Bicycle, Car {...}
public final class Bicycle extends Vehicle {...}
No comments:
Post a Comment