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
38
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
51
Life of our small product
khasunuma
0
36
How to adapt MicroProfile API for generic Web applications
khasunuma
0
35
Overviewing Admin Console
khasunuma
0
34
Introduction to MicroProfile Metrics
khasunuma
0
57
Basic method for Java EE Web Profile
khasunuma
0
32
Introduction to JCA and MDB
khasunuma
0
82
Collections Framework Begineers Guide 2
khasunuma
0
73
Introduction to Date and Time API 4
khasunuma
0
68
Other Decks in Programming
See All in Programming
gunshi
kazupon
1
140
CSC307 Lecture 04
javiergs
PRO
0
650
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.2k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
390
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.6k
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
500
AgentCoreとHuman in the Loop
har1101
5
200
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
610
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
1.3k
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
180
CSC307 Lecture 02
javiergs
PRO
1
770
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
280
Featured
See All Featured
Done Done
chrislema
186
16k
Designing for Performance
lara
610
70k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
48
Measuring & Analyzing Core Web Vitals
bluesmoon
9
740
Being A Developer After 40
akosma
91
590k
Paper Plane (Part 1)
katiecoart
PRO
0
3.7k
The browser strikes back
jonoalderson
0
350
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
430
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Invisible Side of Design
smashingmag
302
51k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
440
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