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
80
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
76
Life of our small product
khasunuma
0
55
How to adapt MicroProfile API for generic Web applications
khasunuma
0
58
Overviewing Admin Console
khasunuma
0
52
Introduction to MicroProfile Metrics
khasunuma
0
85
Basic method for Java EE Web Profile
khasunuma
0
56
Introduction to JCA and MDB
khasunuma
0
110
Collections Framework Begineers Guide 2
khasunuma
0
120
Introduction to Date and Time API 4
khasunuma
0
120
Other Decks in Programming
See All in Programming
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
4
1.4k
Inertia Rails: The One-Person Framework with React & Friends
skryukov
0
190
contenteditable と日本語入力に向き合う
colorful12
0
230
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
130
Kotlinの15年とServer-Side Kotlin
n_takehata
1
170
Jetpack Compose Mechanisms
skydoves
3
900
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
7.1k
Groovy as a human and AI friendly programming language
paulk
0
140
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
530
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
320
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
140
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
230
Featured
See All Featured
Speed Design
sergeychernyshev
33
2.2k
Tell your own story through comics
letsgokoyo
1
1.1k
Practical Orchestrator
shlominoach
192
12k
Building the Perfect Custom Keyboard
takai
2
930
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
2
970
How to build a perfect <img>
jonoalderson
1
6.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.5k
The SEO identity crisis: Don't let AI make you average
varn
0
620
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
500
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
950
A better future with KSS
kneath
240
18k
We Are The Robots
honzajavorek
0
410
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