Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Java 15について軽く/ Java 15 breaf introduction
Search
Naoki Kishida
September 18, 2020
Programming
2
200
Java 15について軽く/ Java 15 breaf introduction
2020/9/18に開催されたJavaコミュ@福岡オンライン飲み会での登壇資料です
Naoki Kishida
September 18, 2020
Tweet
Share
More Decks by Naoki Kishida
See All by Naoki Kishida
Java 22 Overview
kishida
1
220
Is Object-Oriented nessesary?
kishida
0
51
オブジェクト指向は必要なのか / Is object-oriented needed?
kishida
31
22k
AI時代を乗り切る実装力をつけよう / Get avility of implementation beyond AI era
kishida
2
4.7k
AI時代を生き抜くために処理をちゃんと書けるようになろう / write a executable process for AI era
kishida
23
14k
Javaは今どうなっているの? / how about java now
kishida
14
19k
動くコードを書こう / let's code a process
kishida
24
7.2k
Java 21の概要 / outline of Java 21
kishida
10
6.1k
エンジニアはLLMとどう付き合うか / How engineer get along with LLM
kishida
19
14k
Other Decks in Programming
See All in Programming
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
13
4.4k
RailsConf 2024: Riffing on Rails: sketch your way to better designed code
kaspth
1
220
勉強会4_アップデートされたAssistantsAPIを試す
milky04
0
110
Powerfully Typed TypeScript
euxn23
4
1.8k
CREってこういうこと? 体験入社 - 提案資料 - / what-is-cre-trial-employment
shinden
1
620
Enjoy Creative Coding with Ruby (RubyKaigi2024)
chobishiba
0
950
株式会社ゼネテック
genetec
0
130
JS RPCを理解する
yusukebe
5
300
TypeScript Custom GitHub Action Development Tips
peaceiris
5
830
TypeScript 関数型スタイルでバックエンド開発のリアル
naoya
49
16k
freeeのエンジニアが 就活で出そうな コーディングテストを 解説してみる
freee
1
180
Open standards for building event-driven applications in the cloud
meteatamel
0
230
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.7k
Building an army of robots
kneath
300
41k
4 Signs Your Business is Dying
shpigford
176
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
Practical Orchestrator
shlominoach
183
9.8k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.7k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
47k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Transcript
Java 15を軽く LINE Fukuoka きしだ なおき 2020/9/18 Javaコミュ@福岡オンライン飲み会
自己紹介 • きしだ なおき(@kis) • LINE Fukuoka • 最近 洗濯機を買って、ベランダ置きの
洗濯機は台風で汚れるということを知る
Java 15 • 2020/9/15リリース • non-LTS • 次は17(Sept.2021) • 14のJEP
http://openjdk.java.net/projects/jdk/15/
Java 15 • 2020/9/15リリース • non-LTS • 次は17(Sept.2021) • 14のJEP
• 新規は4つ • 更新6 • 機能削除4 http://openjdk.java.net/projects/jdk/15/ 新規 新規 新規 新規
JEP • 言語仕様 • Sealed Classes(Preview) • Text Blocks(Standard) •
Pattern Matching for instanceof (Second Preview) • Records(Second Prevew) • API • Foreign Memory Access (Second Incubator) • Hidden Classes • Reinplement the Legacy DatagramSocket API • Edwards-Curve Digital Signature Algorithm • Remove the Nashorn JS Engine • JVM • Disable and Deprecate Biased Locking • ZGC(Production) • Shenandoah(Production) • Deprecate RMI Activation • OpenJDK • Remove Solaris and SPARK Ports • Tool • remove RMI stub compiler
Sealed Classes • 継承できるクラスを限定する public abstract sealed class Shape permits
Circle, Rectangle, Square {...}
現状では使い道なし • 本当は次のように書けるといい String getName(Shape s) { if (s instanceof
Circle) { return "円"; } else if (s instanceof Rectangle) { return "四角"; } else if (s instanceof Square) { return "正方形"; } }
swtichでパターンマッチングが使えるように なると便利 • Pattern matching for switchが導入されると、次のような switchがdefaultなしで書けるようになる String getName(Shape
s) { switch (s) { case Circle c -> return "円"; case Rectangle r -> return "四角"; case Square q -> return "正方形"; } }
Text Blocks(Standard) • 複数行のテキスト • ダブルクオート3つで囲む • Java 14から変更なし """
<head> <title>Java 14</title> </head> """
Records(2nd Preview) • データをやりとりするための型 • イミュータブル(値が変更できない) • 名前付きタプル • Case
class(Scala) やData class(Kotlin), @Value(Lombok)
定義 public record Rec(String name, int count) {} public class
Rec extends Record { private final String name; private final int count; Rec(String name, int count) { this.name = name; this.count = count; } String name() { return name; } String count() { return count; } // toString, equals, hashCode }
Pattern Matching for instanceof(2nd Preview) • Kotlinのスマートキャストのような機能 Object o =
"test"; if (o instanceof String s) { System.out.println(s.length()); } Object o = "test"; if (o instanceof String) { String s = (String) o; System.out.println(s.length()); }