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
70
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
70
Life of our small product
khasunuma
0
49
How to adapt MicroProfile API for generic Web applications
khasunuma
0
49
Overviewing Admin Console
khasunuma
0
47
Introduction to MicroProfile Metrics
khasunuma
0
75
Basic method for Java EE Web Profile
khasunuma
0
48
Introduction to JCA and MDB
khasunuma
0
100
Collections Framework Begineers Guide 2
khasunuma
0
91
Introduction to Date and Time API 4
khasunuma
0
88
Other Decks in Programming
See All in Programming
テーブルをDELETEした
yuzneri
0
140
霧の中の代数的エフェクト
funnyycat
1
490
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
760
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
460
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
140
yield再入門 #phpcon
o0h
PRO
0
980
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
仕様駆動開発の消費期限
watany
16
7.3k
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
190
メールのエイリアス機能を履き違えない
isshinfunada
0
230
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
120
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
200
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
41k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Designing Powerful Visuals for Engaging Learning
tmiket
1
480
Context Engineering - Making Every Token Count
addyosmani
9
1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
Everyday Curiosity
cassininazir
0
270
How to make the Groovebox
asonas
2
2.3k
The browser strikes back
jonoalderson
0
1.5k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
360
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