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
0
37
JLS myths ~ if-then-else statement ~
HASUNUMA Kenji
October 01, 2016
Tweet
Share
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
50
Life of our small product
khasunuma
0
36
How to adapt MicroProfile API for generic Web applications
khasunuma
0
34
Overviewing Admin Console
khasunuma
0
32
Introduction to MicroProfile Metrics
khasunuma
0
55
Basic method for Java EE Web Profile
khasunuma
0
31
Introduction to JCA and MDB
khasunuma
0
80
Collections Framework Begineers Guide 2
khasunuma
0
68
Introduction to Date and Time API 4
khasunuma
0
68
Other Decks in Programming
See All in Programming
AtCoder Conference 2025
shindannin
0
790
愛される翻訳の秘訣
kishikawakatsumi
3
350
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
320
tparseでgo testの出力を見やすくする
utgwkk
2
310
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
110
Grafana:建立系統全知視角的捷徑
blueswen
0
250
Cap'n Webについて
yusukebe
0
150
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
3
1.3k
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
180
はじめてのカスタムエージェント【GitHub Copilot Agent Mode編】
satoshi256kbyte
0
110
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
380
The Language of Interfaces
destraynor
162
26k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Mobile First: as difficult as doing things right
swwweet
225
10k
The browser strikes back
jonoalderson
0
240
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
220
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
38
The World Runs on Bad Software
bkeepers
PRO
72
12k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
32
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
21
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