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
27
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
40
Life of our small product
khasunuma
0
28
How to adapt MicroProfile API for generic Web applications
khasunuma
0
29
Overviewing Admin Console
khasunuma
0
28
Introduction to MicroProfile Metrics
khasunuma
0
48
Basic method for Java EE Web Profile
khasunuma
0
23
Introduction to JCA and MDB
khasunuma
0
66
Collections Framework Begineers Guide 2
khasunuma
0
63
Introduction to Date and Time API 4
khasunuma
0
59
Other Decks in Programming
See All in Programming
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
410
AI OCR API on Lambdaを Datadogで可視化してみた
nealle
0
220
機能追加とリーダー業務の類似性
rinchoku
0
410
オープンセミナー2025@広島LT技術ブログを続けるには
satoshi256kbyte
0
150
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
340
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
300
時間軸から考えるTerraformを使う理由と留意点
fufuhu
9
3.8k
Kiroで始めるAI-DLC
kaonash
2
510
TDD 実践ミニトーク
contour_gara
1
280
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
100
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
4
1.8k
AIエージェント開発、DevOps and LLMOps
ymd65536
1
370
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
Producing Creativity
orderedlist
PRO
347
40k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
It's Worth the Effort
3n
187
28k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
GitHub's CSS Performance
jonrohan
1032
460k
Music & Morning Musume
bryan
46
6.8k
Optimizing for Happiness
mojombo
379
70k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
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