Martin Ahrer

Thinking outside the box

0001-01-01 1 min read

The following describes selected improvements of the Java language. See the Java 9 release notes.

Unresolved directive in <stdin> - include::TryWithResource.adoc[leveloffset=+1] Unresolved directive in <stdin> - include::PrivateInterfaceMethod.adoc[leveloffset=+1]

0001-01-01 1 min read

An interface can now have private methods. These can simplify implementing default methods.

Say Hello
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/lang/PrivateInterfaceMethod.java[tag=tagname]

0001-01-01 1 min read
Before Java9
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/lang/TryWithResource.java[tag=beforeJava9]

Before Java 9 a variable referencing a resource had to be redeclared (and assigned) in the try block in order to be automatically closed.

With Java9
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/lang/TryWithResource.java[tag=withJava9]

Variables that are effectively final can be used in a try with resource block (and don’t have to be redeclared).

Continue reading

0001-01-01 1 min read

It is now possible to create pre allocated hash maps and hash sets through a set of new factory methods on Set and Map implementations.

New Hash Map
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nineteen/api/CollectionApi.java[tag=newHashMap]
New Hash Set
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nineteen/api/CollectionApi.java[tag=newHashSet]
Continue reading

0001-01-01 1 min read
Of Localized Pattern
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nineteen/api/DateTimeFormatterApi.java[tag=ofLocalizedPattern]

The formatted value is Sep 2022. Read more about the pattern template in the API documentation.

Append Localized
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nineteen/api/DateTimeFormatterApi.java[tag=appendLocalized]

The formatted value is Sep 2022. Read more about the pattern template in the API documentation.

Continue reading

0001-01-01 1 min read

The following describes selected improvements of the Java API. See the Java 19 release notes.

Unresolved directive in <stdin> - include::DateTimeFormatterApi.adoc[leveloffset=+1] Unresolved directive in <stdin> - include::CollectionApi.adoc[leveloffset=+1]

0001-01-01 1 min read

The following describes selected improvements of the Java JVM. See the Java 19 release notes.

Class data sharing (CDS) now has an option -XX:+AutoCreateSharedArchive to automatically create or update a CDS archive for an application..

Older posts Newer posts