Pages

Showing posts with label Java 13. Show all posts
Showing posts with label Java 13. Show all posts

Monday, March 16, 2020

Java Switch Expressions Examples (+Java 13, 12 Vs All Java Older Versions Switch Programs)

1. Introduction


In to days article, We'll learn what is new Java 13 switch expression with example programs. In Java 13, the JEP 354: Switch Expressions extends the previous Java 12 Switch Expressions by adding a new yield keyword to return a value from switch expression. This makes the code so clear and more readable now.

This feature is part of preview features and disabled by default. This needs to be enabled for usage.

Java Switch Expressions Examples (+Java 13, 12 Vs All Java Older Versions Switch Programs)

Wednesday, October 30, 2019

Java 13 API - What Are New Features? (JDK 13 Changes)

1. Introduction


In this article, We will learn what are the new features of Java 13 that are added to JDK 13.

Download JDK 13 from the Oracle official website.

Now we are going to learn about the following new changes step by step. Before that, you may have a question that "Is really JDK 13 has major changes?". Because a new java release is expected for every six months. So, Raising this question is common. Answer to this question is "no" changes are very minor. This does not impact the core developers. Except who closely works on CDS, ZGC, Socket API, and switch expressions (It is good to know).

Below is the complete list of changes in JDK 13.



JEP 350: Dynamic CDS Archives
JEP-351: ZGC: Uncommit Unused Memory
JEP-353: Reimplement the Legacy Socket API
JEP-354: Switch Expressions (Preview) (developer feature)
JEP-355: Text Blocks (Preview) (developer feature)

From this list, the first 3 changes can be used directly but the last two are in preview (developer feature). So, We can not use them directly. You will understand how to use the preview functionalities as we go through them each.