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
26
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
39
Life of our small product
khasunuma
0
27
How to adapt MicroProfile API for generic Web applications
khasunuma
0
28
Overviewing Admin Console
khasunuma
0
27
Introduction to MicroProfile Metrics
khasunuma
0
47
Basic method for Java EE Web Profile
khasunuma
0
22
Introduction to JCA and MDB
khasunuma
0
64
Collections Framework Begineers Guide 2
khasunuma
0
62
Introduction to Date and Time API 4
khasunuma
0
57
Other Decks in Programming
See All in Programming
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
16
6k
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
180
Googleの新しいコーディングAIエージェントJulesを使ってみた
tonionagauzzi
0
120
チームのテスト力を総合的に鍛えて品質、スピード、レジリエンスを共立させる/Testing approach that improves quality, speed, and resilience
goyoki
6
1.2k
オンコール⼊⾨〜ページャーが鳴る前に、あなたが備えられること〜 / Before The Pager Rings
yktakaha4
2
1.1k
QA x AIエコシステム段階構築作戦
osu
0
150
NEWT Backend Evolution
xpromx
1
150
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
300
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
130
Strands Agents で実現する名刺解析アーキテクチャ
omiya0555
1
100
PHPUnitの限界をPlaywrightで補完するテストアプローチ
yuzneri
0
270
Git Sync を超える!OSS で実現する CDK Pull 型デプロイ / Deploying CDK with PipeCD in Pull-style
tkikuc
4
460
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
54k
Optimizing for Happiness
mojombo
379
70k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Adopting Sorbet at Scale
ufuk
77
9.5k
Practical Orchestrator
shlominoach
189
11k
Done Done
chrislema
184
16k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
109
19k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
Building Applications with DynamoDB
mza
95
6.5k
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