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
57
0
Share
JLS myths ~ if-then-else statement ~
HASUNUMA Kenji
October 01, 2016
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
58
Life of our small product
khasunuma
0
47
How to adapt MicroProfile API for generic Web applications
khasunuma
0
45
Overviewing Admin Console
khasunuma
0
44
Introduction to MicroProfile Metrics
khasunuma
0
67
Basic method for Java EE Web Profile
khasunuma
0
41
Introduction to JCA and MDB
khasunuma
0
95
Collections Framework Begineers Guide 2
khasunuma
0
83
Introduction to Date and Time API 4
khasunuma
0
78
Other Decks in Programming
See All in Programming
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.8k
AIを導入する前にやるべきこと
negima
2
350
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
1.2k
tRPCの概要と少しだけパフォーマンス
misoton665
2
270
🦞OpenClaw works with AWS
licux
1
350
いつか誰かが、と思っていた フロントエンド刷新5年間の実践知
kiichisugihara
1
270
JCON - Create Agentic AI Apps, The Easy Way!
kdubois
1
110
t *testing.T は どこからやってくるの?
otakakot
1
930
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
200
AIと共に生きる技術選定 2026
sgash708
0
140
実用!Hono RPC2026
yodaka
2
310
Firefoxにコントリビューションして得られた学び
ken7253
2
160
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
240
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
Balancing Empowerment & Direction
lara
6
1.1k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The Invisible Side of Design
smashingmag
302
52k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
200
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
740
How GitHub (no longer) Works
holman
316
150k
The Cost Of JavaScript in 2023
addyosmani
55
9.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
390
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