File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
java-14/src/main/java/com/ibrahimatay Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ This repository contains Java examples that are designed to track and document t
4242
4343* [ Java 14] ( java-14/ ) (March, 2020)
4444 * [ JEP 361] ( java-14/src/main/java/com/ibrahimatay/JEP361SwitchExpressions.java ) : Switch Expressions
45-
45+ * [ JEP 359] ( java-14/src/main/java/com/ibrahimatay/JEP359Records.java ) : Records (Preview)
46+
4647* [ Java 12] ( java-12/ ) (March, 2019)
4748 * API Improvements
4849 * [ Compact Number Formatting] ( java-12/src/main/java/com/ibrahimatay/CompactNumberFormatting.java )
Original file line number Diff line number Diff line change 1+ package com .ibrahimatay ;
2+
3+ public class JEP359Records {
4+
5+ public static void main (String [] args ) {
6+ // JEP 359: Records (Preview)
7+ // https://openjdk.org/jeps/359
8+ }
9+ }
10+
11+ class Person {
12+ private final String name ;
13+ private final int age ;
14+
15+ Person (String name , int age ) {
16+ this .name = name ;
17+ this .age = age ;
18+ }
19+ }
20+
21+ // record Person(String name, int age) {}
22+
23+
You can’t perform that action at this time.
0 commit comments