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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
HASUNUMA Kenji
October 01, 2016
Programming
71
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JLS myths ~ if-then-else statement ~
HASUNUMA Kenji
October 01, 2016
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
72
Life of our small product
khasunuma
0
50
How to adapt MicroProfile API for generic Web applications
khasunuma
0
50
Overviewing Admin Console
khasunuma
0
49
Introduction to MicroProfile Metrics
khasunuma
0
78
Basic method for Java EE Web Profile
khasunuma
0
49
Introduction to JCA and MDB
khasunuma
0
110
Collections Framework Begineers Guide 2
khasunuma
0
91
Introduction to Date and Time API 4
khasunuma
0
90
Other Decks in Programming
See All in Programming
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
860
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
400
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
1
490
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
220
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
310
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
180
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
110
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
170
MySQLとPostgreSQLって何が違うの?
akagami
PRO
0
170
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
270
XHTMLが残したもの
yosuke_furukawa
PRO
1
410
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Designing Experiences People Love
moore
143
24k
Ethics towards AI in product and experience design
skipperchong
2
360
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
sira's awesome portfolio website redesign presentation
elsirapls
0
400
So, you think you're a good person
axbom
PRO
2
2.1k
The Curse of the Amulet
leimatthew05
2
14k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
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