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
52
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
57
Life of our small product
khasunuma
0
46
How to adapt MicroProfile API for generic Web applications
khasunuma
0
43
Overviewing Admin Console
khasunuma
0
42
Introduction to MicroProfile Metrics
khasunuma
0
65
Basic method for Java EE Web Profile
khasunuma
0
40
Introduction to JCA and MDB
khasunuma
0
92
Collections Framework Begineers Guide 2
khasunuma
0
81
Introduction to Date and Time API 4
khasunuma
0
77
Other Decks in Programming
See All in Programming
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
470
Don't Prompt Harder, Structure Better
kitasuke
0
770
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
380
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
170
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
620
ハーネスエンジニアリングとは?
kinopeee
11
5.7k
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
970
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
790
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
160
🦞OpenClaw works with AWS
licux
1
150
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
310
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
270
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
530
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
110
Building the Perfect Custom Keyboard
takai
2
730
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
130
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Skip the Path - Find Your Career Trail
mkilby
1
110
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
800
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