Home » Java » Core Java

Core Java

Performance impact of java.lang.System.getProperty()

‘java.lang.System.getProperty()’ is a common API used by Java developers to read the System properties that are configured during application startup time. i.e. when you pass “-DappName=buggyApp” as your application’s startup JVM argument, the value of the ‘appName’ system property can be read by invoking the ‘java.lang.System.getProperty()’. Example: public static String getAppName() { String app = System.getProperty("appName"); return app; } When ...

Read More »

Chasing Java’s release train: JDK-17, the next big thing

Here we go, JDK-17, the next LTS release, just became generally available. It is an important milestone for the OpenJDK for years to come but sadly, Project Loom, the most anticipated improvement of the JVM platform, was not able to make it, despite the extraordinary progress being made. Well, if you are still on JDK-8, like the majority of us, ...

Read More »

Google Cloud Deploy – CD for a Java based project

This is a short write-up on using Google Cloud Deploy for Continuous Deployment of a Java-based project.  Google Cloud Deploy is a new entrant to the CD space. It facilitates a continuous deployment currently to GKE based targets and in future to other Google Cloud application runtime targets. Let’s start with why such a tool is required, why not an ...

Read More »

More Frequent Java Long-Term Releases

A little over four years ago, Mark Reinhold (Chief Architect of the Java Platform Group at Oracle) stated in his blog post “Moving Java Forward Faster“: “For Java to remain competitive it must not just continue to move forward — it must move forward faster.” In that post, Reinhold proposed “that after Java 9 we adopt a strict, time-based model with a ...

Read More »

JDK 18: Code Snippets in Java API Documentation

OpenJDK 18 Early-Access Build 16 (2021/9/23) is now available and includes the implementation for JEP 413 (“Code Snippets in Java API Documentation“), which is targeted for JDK 18. The objective of JEP 413 is to “introduce an @snippet tag for JavaDoc’s Standard Doclet, to simplify the inclusion of example source code in API documentation” and the JEP itself covers the ...

Read More »

The Premium Java Programming Certification Bundle

Master The Ins & Outs of Java Programming Then Learn Useful Software Principles, Ace Interviews, and Become an Industry-Ready Programmer Hey fellow geeks, This week, on our JCG Deals store, we have another extreme offer. We are offering a massive 98% off on The Premium Java Programming Certification Bundle. Get it now with only $29,99 instead of the original price ...

Read More »

Java’s Optional Does Not Supplant All Traditional if-null-else or if-not-null-else Checks

Java‘s addition of java.util.Optional has been welcome and had led to more fluent code for methods that cannot always return non-null values. Unfortunately, Optional has been abused and one type of abuse has been overuse. I occasionally have run across code that makes use of Optional when there is no clear advantage over using null directly. A red flag that ...

Read More »

Java 17: Pattern Matching for Switch

In Java 17 (released only a few days ago), Pattern Matching for switch has been introduced as a preview language feature, which allows case labels with patterns rather than just constants. Here is an example showing how you can match on type patterns: public static String typedPatternMatching(Object o) { return switch(o) { case null -> "I am null"; case String ...

Read More »

Java 17 the new LTS version is finally here!

Java 17, the new long-term support aka LTS is now available for use and support for many years to come. Let’s remind here that  Non-LTS releases get six months of support from Oracle. You can download it here JDK 17 GA Release (java.net) New Capabilities JDK 17 features everything that has been added since the last LTS release that was ...

Read More »