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
23
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
37
Life of our small product
khasunuma
0
19
How to adapt MicroProfile API for generic Web applications
khasunuma
0
25
Overviewing Admin Console
khasunuma
0
22
Introduction to MicroProfile Metrics
khasunuma
0
46
Basic method for Java EE Web Profile
khasunuma
0
22
Introduction to JCA and MDB
khasunuma
0
59
Collections Framework Begineers Guide 2
khasunuma
0
59
Introduction to Date and Time API 4
khasunuma
0
55
Other Decks in Programming
See All in Programming
知識0からカンファレンスやってみたらこうなった!
syossan27
5
300
Road to Ruby for A Linguistics Nerd
hayat01sh1da
PRO
0
390
The New Developer Workflow: How AI Transforms Ideas into Code
danielsogl
0
150
Beyond_the_Prompt__Evaluating__Testing__and_Securing_LLM_Applications.pdf
meteatamel
0
120
カウシェで Four Keys の改善を試みた理由
ike002jp
1
140
インプロセスQAにおいて大事にしていること / In-process QA Meetup
medley
0
190
リアーキテクチャの現場で向き合う 既存サービスの読み解きと設計判断
ymiyamu
0
140
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
260
SpringBootにおけるオブザーバビリティのなにか
irof
0
240
Designing Your Organization's Test Pyramid ( #scrumniigata )
teyamagu
PRO
5
1.7k
rbs-traceを使ってWEARで型生成を試してみた After RubyKaigi 2025〜ZOZO、ファインディ、ピクシブ〜 / tried rbs-trace on WEAR
oyamakei
0
200
Digging into the Matrix: Practicing Code Archaeology
arthurdoler
PRO
0
120
Featured
See All Featured
How GitHub (no longer) Works
holman
314
140k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
810
Practical Orchestrator
shlominoach
187
11k
Art, The Web, and Tiny UX
lynnandtonic
298
21k
Being A Developer After 40
akosma
91
590k
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