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
190
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
180
Is Object-Oriented nessesary?
kishida
0
41
オブジェクト指向は必要なのか / Is object-oriented needed?
kishida
31
22k
AI時代を乗り切る実装力をつけよう / Get avility of implementation beyond AI era
kishida
2
4.6k
AI時代を生き抜くために処理をちゃんと書けるようになろう / write a executable process for AI era
kishida
23
12k
Javaは今どうなっているの? / how about java now
kishida
14
19k
動くコードを書こう / let's code a process
kishida
24
7.1k
Java 21の概要 / outline of Java 21
kishida
10
6.1k
エンジニアはLLMとどう付き合うか / How engineer get along with LLM
kishida
19
13k
Other Decks in Programming
See All in Programming
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
430
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
950
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
340
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
370
Ruby Pattern Matching
bkuhlmann
0
930
2 週間で Twitter Bot を作ってみた
contour_gara
0
540
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
380
"config" ってなんだ? / What is "config"?
okashoi
0
240
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
210
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
540
Fast JSX: Don't clone props object #28768
yossydev
1
130
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
21
1.6k
Clear Off the Table
cherdarchuk
84
310k
Statistics for Hackers
jakevdp
789
220k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Automating Front-end Workflow
addyosmani
1356
200k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Facilitating Awesome Meetings
lara
42
5.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
260
12k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
Designing for humans not robots
tammielis
248
25k
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()); }