The evolution of Java

The evolution of Java

Even though Java is becoming a bit less popular these days due to various reasons it's still relevant.

I have made a cursory glance when it comes to later generations of Java (up to Java 15) where there are a few points that might be of interest for those working with Java. At least these are the points that I think are most interesting and useful.

?   Sealed Classes. (Java 15)

The parent class declares which other classes that may extend the sealed class.

?   Pattern matching of instanceof. (Java 14)

This is effectively changing the 2 stage of first doing an instanceof check and then a type cast.

?   Records. (Java 14)

These items are effectively data carrying classes that can't be subclassed and can't extend classes as well as all fields declared by them are 'final' so that the data can't be modified as soon as the record is created. This also exists when you code in F#.

?   Helpful NullPointerExceptions. (Java 14)

If you get a NullPointerException at a construct "a.b.c.d" then it's tricky to figure out which level that the NPE actually applies to, and the updated version will tell which variable in the construct that was null.

?   Text blocks. (Java 13)

Allows the user to have multi-line text in the source code without string delimiters on every row.

?   More compact Switch statements. (Java 13)

These might as I see it be useful to generate more compact code, but it will also be a bit harder to read and make it harder to port the code.

?   Socket API is reimplemented. (Java 13)

Old socket API stemmed from Java 1.0. However no actual changes to the Java code. "Only" the underlying implementation. This was introduced in Java 13. So anyone upgrading to Java 13 or later and using sockets should at least consider to test their functionality a little extra.

?   Nest-Based access control (Java 11)

An inner class has earlier been able to access private methods in the outer class. However there have been an inconsistency with the "getDeclaredMethod()" method and is also breaking the notion of "private". Java 11 introduces access control for the nested elements. See more here: https://www.baeldung.com/java-nest-based-access-control

?   A No-Op Garbage Collector (Java 11)

If you want to run your application until you get an OutOfMemoryException then this would be interesting to you. Use "-XX:+UseEpsilonGC" to enable this. Reasons for selecting this could be testing or that you want to have a deterministic timing once the application starts but that the application terminates after the job is done and you'll never really is concerned about GC anyway.

?   Java EE and CORBA modules removed (Java 11)

These parts are provided in third party implementations, so the parts that are in SE were considered obsolete since Java 9. Use for example the WildFly Application Server to achieve the needed parts.

?   Standardizes HTTP Client API (Java 11)

This API supports both HTTP/1.1 and HTTP/2.

?   Unicode 10 (Java 11)

?   Java Flight Recorder (Java 11)

Java Flight Recorder (JFR) is a tool for collecting diagnostic and profiling data about a running Java application. It is integrated into the Java Virtual Machine (JVM) and causes almost no performance overhead, so it can be used even in heavily loaded production environments.

?   Additional Unicode Language-Tag Extensions (Java 10)

Enhancement of java.util.Locale and related APIs to implement additional Unicode extensions.

?   Javah has been removed (Java 10)

Use "javac -h" instead to generate native header files.

?   Мulti-Resolution Image API (Java 9)

The interface java.awt.image.MultiResolutionImage encapsulates a set of images with different resolutions into a single object.

?   Immutable Set (Java 9)

java.util.Set.of() – creates an immutable set of a given elements. This will create a set where you can't add or remove elements.

要查看或添加评论,请登录

Nils Hammar的更多文章

  • No one will ever blame you.

    No one will ever blame you.

    The following story comes from the Wikipedia page about Richard Hamming. ( https://en.

  • Some statements to consider

    Some statements to consider

    Here are a few statements that I have collected. Below are some system design statements to consider whenever designing…

  • Ett Fossilfritt Sverige

    Ett Fossilfritt Sverige

    I en artikel i DN s? h?nvisas det till att Sverige skall ha netto nollutsl?pp ?r 2045. Det ?r v?llovligt, men…

  • Python is to 2020 what interpreting Basic was to 1985

    Python is to 2020 what interpreting Basic was to 1985

    This article is bound to upset some Python fans and those that trust external sources. Both Python and Basic shares…

    2 条评论
  • System Design Considerations

    System Design Considerations

    During my years I have accumulated some experience regarding what's good and bad in the world of designing systems…

  • Machine shop skills are getting rare

    Machine shop skills are getting rare

    The ability to work a machine shop is a great skill to have even in these days. Skilled machinists seems to be a rare…

  • Improve your Java code quality

    Improve your Java code quality

    By delivering a high quality code you will lower the maintenance cost of the system. The tools presented in this…

    1 条评论
  • Cobol - an obsolete language?

    Cobol - an obsolete language?

    The jokes about Cobol aside - it seems like there's a shortage of people that knows Cobol. On YouTube there's a "crash…

    3 条评论
  • Official COVID-19 hackathon in Sweden

    Official COVID-19 hackathon in Sweden

    An initiative by The Swedish Government. The new COVID-19 virus is testing our country, our society and us as citizens.

  • From New York Gov. Andrew Cuomo Briefing

    From New York Gov. Andrew Cuomo Briefing

    Some things to think about. Better be safe than sorry and see someone drowning in their own fluids.

社区洞察

其他会员也浏览了