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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
HASUNUMA Kenji
October 01, 2016
Programming
85
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
Transcript
10 slides
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
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
82
Life of our small product
khasunuma
0
57
How to adapt MicroProfile API for generic Web applications
khasunuma
0
63
Overviewing Admin Console
khasunuma
0
56
Introduction to MicroProfile Metrics
khasunuma
0
90
Basic method for Java EE Web Profile
khasunuma
0
59
Introduction to JCA and MDB
khasunuma
0
120
Collections Framework Begineers Guide 2
khasunuma
0
120
Introduction to Date and Time API 4
khasunuma
0
130
Other Decks in Programming
See All in Programming
AI-Powered Domain-Driven Design
ziobrando
0
470
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
200
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
310
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
380
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
590
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
220
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
AI Augmentation Techniques with Liberty
ivargrimstad
1
520
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
430
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
340
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
200
Featured
See All Featured
Writing Fast Ruby
sferik
630
63k
ラッコキーワード サービス紹介資料
rakko
5
5.9M
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.2k
The untapped power of vector embeddings
frankvandijk
2
2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
480
Fireside Chat
paigeccino
43
4.1k
Test your architecture with Archunit
thirion
2
2.5k
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
580
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k