Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JLS myths ~ if-then-else statement ~
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
HASUNUMA Kenji
October 01, 2016
Programming
78
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
74
Life of our small product
khasunuma
0
53
How to adapt MicroProfile API for generic Web applications
khasunuma
0
53
Overviewing Admin Console
khasunuma
0
51
Introduction to MicroProfile Metrics
khasunuma
0
82
Basic method for Java EE Web Profile
khasunuma
0
51
Introduction to JCA and MDB
khasunuma
0
110
Collections Framework Begineers Guide 2
khasunuma
0
93
Introduction to Date and Time API 4
khasunuma
0
98
Other Decks in Programming
See All in Programming
AWSに止められる覚悟してますか?
morizo_1984
2
520
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
130
JRuby: Past, Present, and Future
headius
0
220
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
450
mrbgem 三角測量 開発
ogom
0
220
Simple Storage Service(S3) is not simple
iwatsukayura
0
230
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
120
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
360
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
最近”作らせてる” ローカルAIアプリの話
akit37
0
410
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
720
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.3k
My Coaching Mixtape
mlcsv
0
340
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
400
30 Presentation Tips
portentint
PRO
1
420
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Visualization
eitanlees
153
17k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
400
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