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
46
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
55
Life of our small product
khasunuma
0
45
How to adapt MicroProfile API for generic Web applications
khasunuma
0
41
Overviewing Admin Console
khasunuma
0
40
Introduction to MicroProfile Metrics
khasunuma
0
63
Basic method for Java EE Web Profile
khasunuma
0
38
Introduction to JCA and MDB
khasunuma
0
91
Collections Framework Begineers Guide 2
khasunuma
0
80
Introduction to Date and Time API 4
khasunuma
0
76
Other Decks in Programming
See All in Programming
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
130
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
540
Nuxt Server Components
wattanx
0
240
「速くなった気がする」をデータで疑う
senleaf24
0
130
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
190
安いハードウェアでVulkan
fadis
1
870
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
120
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
440
20260320登壇資料
pharct
0
150
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.2k
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.4k
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
For a Future-Friendly Web
brad_frost
183
10k
How to Ace a Technical Interview
jacobian
281
24k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
170
Unsuck your backbone
ammeep
672
58k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
How GitHub (no longer) Works
holman
316
150k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
230
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
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