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
57
0
Share
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
58
Life of our small product
khasunuma
0
47
How to adapt MicroProfile API for generic Web applications
khasunuma
0
45
Overviewing Admin Console
khasunuma
0
44
Introduction to MicroProfile Metrics
khasunuma
0
67
Basic method for Java EE Web Profile
khasunuma
0
41
Introduction to JCA and MDB
khasunuma
0
95
Collections Framework Begineers Guide 2
khasunuma
0
83
Introduction to Date and Time API 4
khasunuma
0
78
Other Decks in Programming
See All in Programming
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
150
Making the RBS Parser Faster
soutaro
0
710
Road to RubyKaigi: Play Hard(ware)
makicamel
1
570
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
810
継続的な負荷検証を目指して
pyama86
3
1.1k
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
2.9k
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
160
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
700
GoogleCloudとterraform完全に理解した
terisuke
1
190
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
360
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
390
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
550
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
How STYLIGHT went responsive
nonsquared
100
6.1k
Everyday Curiosity
cassininazir
0
210
Building Applications with DynamoDB
mza
96
7k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
140
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
300
The untapped power of vector embeddings
frankvandijk
2
1.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
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