0% found this document useful (0 votes)
1 views

Java Unit 3.Pdf1

Java assignment

Uploaded by

aniketgupta3625
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Java Unit 3.Pdf1

Java assignment

Uploaded by

aniketgupta3625
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Java New Features

Unit-3
Stream API is a newly added feature to the Collections API in Java 8. A
stream represents a sequence of elements & supports different operations
(Filter, Sort, Map, and Collect) from a collection.
Static method is a static member to the Interface, cant be overridden
(as with the class), default method is the default implementation of a
method which might be overridden.
Difference between Static Interface Method and Default Interface Method
ForEach Method
This is how JDK now looks
like. On the bottom, we
have “java.base” module
that every other module
implicitly or explicitly depends
on. As you can see, this
dependency graph is
a DAG which means no
circular dependency allowed.

It is a name of module and should follow the reverse-domain-pattern.


Like we name packages, e.g. com.itechworld.
Diamond Syntax with Inner Anonymous Class

, It is an inner class without a name and for which


only a single object is created. An anonymous inner class can be useful
when making an instance of an object with certain “extras” such as
overriding methods of a class or interface, without having to actually
subclass a class.
Diamond syntax, sometimes known as the
diamond operator, It was added to Java 7 as just
a new feature. The diamond operator makes it
easier to employ generics while building an
object.
The Java releases up to and including 13 are rather manageable in terms
of their innovations. This is true even for Java 11 as an LTS version.
Fortunately, Java 14 brings a good slew of useful enhancements:
On the one hand, there are the convenient syntax changes in switch.

Let me conclude: The new syntax of switch seems to be just a small


change, but it has an enormous effect on readability and ease of use.

You might also like