$30 off During Our Annual Pro Sale. View Details »
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
34
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
46
Life of our small product
khasunuma
0
35
How to adapt MicroProfile API for generic Web applications
khasunuma
0
32
Overviewing Admin Console
khasunuma
0
31
Introduction to MicroProfile Metrics
khasunuma
0
54
Basic method for Java EE Web Profile
khasunuma
0
30
Introduction to JCA and MDB
khasunuma
0
76
Collections Framework Begineers Guide 2
khasunuma
0
66
Introduction to Date and Time API 4
khasunuma
0
65
Other Decks in Programming
See All in Programming
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
230
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
140
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
710
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
600
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.5k
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
120
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.8k
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
240
生成AIを利用するだけでなく、投資できる組織へ
pospome
1
250
チームをチームにするEM
hitode909
0
300
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
110
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.8k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
How STYLIGHT went responsive
nonsquared
100
6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Unsuck your backbone
ammeep
671
58k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Git: the NoSQL Database
bkeepers
PRO
432
66k
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