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
29
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
43
Life of our small product
khasunuma
0
30
How to adapt MicroProfile API for generic Web applications
khasunuma
0
29
Overviewing Admin Console
khasunuma
0
28
Introduction to MicroProfile Metrics
khasunuma
0
51
Basic method for Java EE Web Profile
khasunuma
0
27
Introduction to JCA and MDB
khasunuma
0
68
Collections Framework Begineers Guide 2
khasunuma
0
64
Introduction to Date and Time API 4
khasunuma
0
60
Other Decks in Programming
See All in Programming
Researchlyの開発で参考にしたデザイン
adsholoko
0
110
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
110
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
910
AIのバカさ加減に怒る前にやっておくこと
blueeventhorizon
0
140
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
450
ALL CODE BASE ARE BELONG TO STUDY
uzulla
29
6.9k
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
330
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
3
1.8k
NIKKEI Tech Talk#38
cipepser
0
360
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
1.1k
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
520
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
250
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
12k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Become a Pro
speakerdeck
PRO
29
5.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Embracing the Ebb and Flow
colly
88
4.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Music & Morning Musume
bryan
46
6.9k
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