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
52
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
57
Life of our small product
khasunuma
0
46
How to adapt MicroProfile API for generic Web applications
khasunuma
0
43
Overviewing Admin Console
khasunuma
0
42
Introduction to MicroProfile Metrics
khasunuma
0
65
Basic method for Java EE Web Profile
khasunuma
0
40
Introduction to JCA and MDB
khasunuma
0
92
Collections Framework Begineers Guide 2
khasunuma
0
81
Introduction to Date and Time API 4
khasunuma
0
77
Other Decks in Programming
See All in Programming
Programming with a DJ Controller — not vibe coding
m_seki
3
130
iOS機能開発のAI環境と起きた変化
ryunakayama
0
190
Coding as Prompting Since 2025
ragingwind
0
840
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
200
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
640
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
830
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
5k
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
520
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
380
Back to the roots of date
jinroq
0
260
🦞OpenClaw works with AWS
licux
1
150
[RubyKaigi 2026] Require Hooks
palkan
1
210
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
10
37k
4 Signs Your Business is Dying
shpigford
187
22k
RailsConf 2023
tenderlove
30
1.4k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
320
Google's AI Overviews - The New Search
badams
0
980
How to make the Groovebox
asonas
2
2.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Faster Mobile Websites
deanohume
310
31k
30 Presentation Tips
portentint
PRO
1
280
Documentation Writing (for coders)
carmenintech
77
5.3k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
530
GitHub's CSS Performance
jonrohan
1032
470k
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