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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
HASUNUMA Kenji
October 01, 2016
Programming
0
44
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
40
Overviewing Admin Console
khasunuma
0
39
Introduction to MicroProfile Metrics
khasunuma
0
61
Basic method for Java EE Web Profile
khasunuma
0
38
Introduction to JCA and MDB
khasunuma
0
90
Collections Framework Begineers Guide 2
khasunuma
0
79
Introduction to Date and Time API 4
khasunuma
0
74
Other Decks in Programming
See All in Programming
モダンOBSプラグイン開発
umireon
0
120
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
950
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
2
320
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
140
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
420
Unity6.3 AudioUpdate
cova8bitdots
0
130
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
550
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
220
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
110
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
300
How to train your dragon (web standard)
notwaldorf
97
6.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
52k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
390
Balancing Empowerment & Direction
lara
5
940
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
200
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
720
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
Writing Fast Ruby
sferik
630
63k
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