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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
HASUNUMA Kenji
October 01, 2016
Programming
0
41
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
53
Life of our small product
khasunuma
0
39
How to adapt MicroProfile API for generic Web applications
khasunuma
0
38
Overviewing Admin Console
khasunuma
0
36
Introduction to MicroProfile Metrics
khasunuma
0
59
Basic method for Java EE Web Profile
khasunuma
0
37
Introduction to JCA and MDB
khasunuma
0
87
Collections Framework Begineers Guide 2
khasunuma
0
77
Introduction to Date and Time API 4
khasunuma
0
72
Other Decks in Programming
See All in Programming
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
310
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
420
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
350
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
110
AIプロダクト時代のQAエンジニアに求められること
imtnd
2
660
株式会社 Sun terras カンパニーデック
sunterras
0
2k
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
320
atmaCup #23でAIコーディングを活用した話
ml_bear
4
730
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
110
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
350
Python’s True Superpower
hynek
0
200
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
160
Featured
See All Featured
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
Are puppies a ranking factor?
jonoalderson
1
3.1k
A Tale of Four Properties
chriscoyier
162
24k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.3k
The Invisible Side of Design
smashingmag
302
51k
AI: The stuff that nobody shows you
jnunemaker
PRO
3
350
For a Future-Friendly Web
brad_frost
183
10k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.4k
The SEO Collaboration Effect
kristinabergwall1
0
380
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
340
From π to Pie charts
rasagy
0
140
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