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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
HASUNUMA Kenji
October 01, 2016
Programming
46
0
Share
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
55
Life of our small product
khasunuma
0
45
How to adapt MicroProfile API for generic Web applications
khasunuma
0
41
Overviewing Admin Console
khasunuma
0
40
Introduction to MicroProfile Metrics
khasunuma
0
63
Basic method for Java EE Web Profile
khasunuma
0
38
Introduction to JCA and MDB
khasunuma
0
91
Collections Framework Begineers Guide 2
khasunuma
0
80
Introduction to Date and Time API 4
khasunuma
0
76
Other Decks in Programming
See All in Programming
「速くなった気がする」をデータで疑う
senleaf24
0
130
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.2k
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.3k
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
110
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
180
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
230
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
290
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
120
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
280
Featured
See All Featured
Paper Plane
katiecoart
PRO
1
48k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
150
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
370
Ruling the World: When Life Gets Gamed
codingconduct
0
190
Building the Perfect Custom Keyboard
takai
2
720
Documentation Writing (for coders)
carmenintech
77
5.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
290
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
310
30 Presentation Tips
portentint
PRO
1
270
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