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
JLS myths ~ if-then-else statement ~
Search
HASUNUMA Kenji
October 01, 2016
Programming
0
43
JLS myths ~ if-then-else statement ~
HASUNUMA Kenji
October 01, 2016
Tweet
Share
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
53
Life of our small product
khasunuma
0
39
How to adapt MicroProfile API for generic Web applications
khasunuma
0
39
Overviewing Admin Console
khasunuma
0
38
Introduction to MicroProfile Metrics
khasunuma
0
60
Basic method for Java EE Web Profile
khasunuma
0
38
Introduction to JCA and MDB
khasunuma
0
89
Collections Framework Begineers Guide 2
khasunuma
0
78
Introduction to Date and Time API 4
khasunuma
0
74
Other Decks in Programming
See All in Programming
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
130
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
680
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
540
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
190
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
420
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
330
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.3k
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
250
Docコメントで始める簡単ガードレール
keisukeikeda
1
110
Windows on Ryzen and I
seosoft
0
250
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
The Cult of Friendly URLs
andyhume
79
6.8k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Balancing Empowerment & Direction
lara
5
940
How to make the Groovebox
asonas
2
2k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
110
My Coaching Mixtape
mlcsv
0
69
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
210
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Designing for Performance
lara
611
70k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Transcript
JLS myths ~ if-then-else statement ~ HASUNUMA Kenji
[email protected]
GlassFish
Users Group Japan
if-else statement if ( someObject.eval() ) if ( otherObject.eval() )
func1(); else func2(); assume that someObject.eval() is false. which is run, func1 or func2?
if-else statement if ( someObject.eval() ) if ( otherObject.eval() )
func1(); else func2(); assume that someObject.eval() is false. Neither func1 nor func2 is run.
if-else statement if ( someObject.eval() ) if ( otherObject.eval() )
func1(); else func2(); It's if-else's short-circuit. Don't be misled by source code format!
From JLS (Java SE 8) IfThenStatement: if ( Expression )
Statement IfThenElseStatement: if ( Expression ) StatementNoShortIf else Statement IfThenElseStatementNoShortIf: if ( Expression ) StatementNoShortIf else StatementNoShortIf
Statement Statement: StatementWithoutTrailingSubstatement LabeledStatement IfThenStatement IfThenElseStatement WhileStatement ForStatement
StatementNoShortIf StatementNoShortIf: StatementWithoutTrailingSubstatement LabeledStatementNoShortIf IfThenElseStatementNoShortIf WhileStatementNoShortIf ForStatementNoShortIf *** 'IfThenStatementNoShortIf' don't
exist ***
if-else statement (fixed) if ( someObject.eval() ) { if (
otherObject.eval() ) func1(); } else func2(); assume that someObject.eval() is false. which is run, func1 or func2?
if-else statement (fixed) if ( someObject.eval() ) { if (
otherObject.eval() ) func1(); } else func2(); func2 is run! because it use block as statement in outer if statement
JLS myths ~ If-then-else statement ~ HASUNUMA Kenji
[email protected]
GlassFish
Users Group Japan