Below you will find pages that utilize the taxonomy term “switch expressions”
Post
Java 12 Switch Expressions
Oracle will release Java 12 in March and it comes with a handful of new features. I’m going to cover them in the next few posts. We’ll start this week with switch expressions. I’ll take a look at how they change how you’ll use the language.
A Basic Class
Let’s start with a simple car class.
public class Car {
public enum Model {
Standard,
Deluxe,
Limited
}
private final Model model;
public Car(Model model) {
this.