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
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
認証・認可の基本を学ぼう前編
kouyuume
0
190
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
260
チームをチームにするEM
hitode909
0
300
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
370
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
310
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.8k
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
140
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
3k
関数実行の裏側では何が起きているのか?
minop1205
1
680
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
800
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
210
connect-python: convenient protobuf RPC for Python
anuraaga
0
400
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.1k
How GitHub (no longer) Works
holman
316
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
The Invisible Side of Design
smashingmag
302
51k
Become a Pro
speakerdeck
PRO
31
5.7k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Optimizing for Happiness
mojombo
379
70k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
A Tale of Four Properties
chriscoyier
162
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
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