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
18
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
31
Life of our small product
khasunuma
0
17
How to adapt MicroProfile API for generic Web applications
khasunuma
0
16
Overviewing Admin Console
khasunuma
0
15
Introduction to MicroProfile Metrics
khasunuma
0
39
Basic method for Java EE Web Profile
khasunuma
0
13
Introduction to JCA and MDB
khasunuma
0
46
Collections Framework Begineers Guide 2
khasunuma
0
46
Introduction to Date and Time API 4
khasunuma
0
45
Other Decks in Programming
See All in Programming
Effectで作る堅牢でスケーラブルなAPIゲートウェイ / Robust and Scalable API Gateway Built on Effect
yasaichi
7
1.2k
TypeScriptで使いやすいOpenAPIの書き方
yukimochi_dwango
0
440
WinActorの勉強を継続する方法
tamai_63
0
130
Adding Security to Microcontroller Ruby
sylph01
0
140
TypeScriptの型とパフォーマンス (TSKaigi 2024)
ypresto
14
4.3k
ペパボOpenTelemetry革命
pyama86
2
310
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
130
TypeScriptでもLLMアプリケーション開発 / LLM Application In Typescript
rkaga
5
1.3k
TypeScriptコードの漸進的改善 / Progressive Improvement of TypeScript Code
medley
1
410
Kotlin Multiplatform at Stable and Beyond (Android Makers 2024)
zsmb
0
600
Open AI APIを使う前に知っておきたいアカウントTier の話
akki_megane
0
120
Native Federation: The Future of Micro Frontends in Angular
manfredsteyer
PRO
0
160
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.7k
Designing for Performance
lara
601
67k
Teambox: Starting and Learning
jrom
128
8.4k
Scaling GitHub
holman
457
140k
Fireside Chat
paigeccino
22
2.7k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
RailsConf 2023
tenderlove
9
580
How to Ace a Technical Interview
jacobian
273
22k
What the flash - Photography Introduction
edds
64
11k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
Web Components: a chance to create the future
zenorocha
306
41k
Building Adaptive Systems
keathley
32
1.9k
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