Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
33
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
34
How to adapt MicroProfile API for generic Web applications
khasunuma
0
31
Overviewing Admin Console
khasunuma
0
30
Introduction to MicroProfile Metrics
khasunuma
0
52
Basic method for Java EE Web Profile
khasunuma
0
28
Introduction to JCA and MDB
khasunuma
0
72
Collections Framework Begineers Guide 2
khasunuma
0
64
Introduction to Date and Time API 4
khasunuma
0
64
Other Decks in Programming
See All in Programming
Building AI with AI
inesmontani
PRO
1
390
FlutterKaigi 2025 システム裏側
yumnumm
0
1.2k
【レイトレ合宿11】kagayaki_v4
runningoutrate
0
100
アーキテクチャと考える迷子にならない開発者テスト
irof
9
3.4k
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
3
10k
sbt 2
xuwei_k
0
110
モダンJSフレームワークのビルドプロセス 〜なぜReactは503行、Svelteは12行なのか〜
fuuki12
0
140
React Native New Architecture 移行実践報告
taminif
1
120
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
4
360
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
180
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
310
無秩序からの脱却 / Emergence from chaos
nrslib
2
10k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.8k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Facilitating Awesome Meetings
lara
57
6.6k
Speed Design
sergeychernyshev
33
1.3k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
What's in a price? How to price your products and services
michaelherold
246
12k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.1k
A Tale of Four Properties
chriscoyier
162
23k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Navigating Team Friction
lara
190
16k
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