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
70
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JLS myths ~ if-then-else statement ~
HASUNUMA Kenji
October 01, 2016
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
67
Life of our small product
khasunuma
0
49
How to adapt MicroProfile API for generic Web applications
khasunuma
0
47
Overviewing Admin Console
khasunuma
0
47
Introduction to MicroProfile Metrics
khasunuma
0
74
Basic method for Java EE Web Profile
khasunuma
0
48
Introduction to JCA and MDB
khasunuma
0
100
Collections Framework Begineers Guide 2
khasunuma
0
88
Introduction to Date and Time API 4
khasunuma
0
88
Other Decks in Programming
See All in Programming
act1-costs.pdf
sumedhbala
0
210
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
160
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
320
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
220
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
2.4k
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
460
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
410
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
フィードバックで育てるAI開発
kotaminato
1
110
どこまでゆるくて許されるのか
tk3fftk
0
480
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
510
自作OSでスライド発表する
uyuki234
1
3.8k
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Pragmatic Product Professional
lauravandoore
37
7.4k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
630
Crafting Experiences
bethany
1
210
YesSQL, Process and Tooling at Scale
rocio
174
15k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Automating Front-end Workflow
addyosmani
1370
210k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
750
Ruling the World: When Life Gets Gamed
codingconduct
0
280
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
Into the Great Unknown - MozCon
thekraken
41
2.6k
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