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
19
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
35
Life of our small product
khasunuma
0
18
How to adapt MicroProfile API for generic Web applications
khasunuma
0
21
Overviewing Admin Console
khasunuma
0
19
Introduction to MicroProfile Metrics
khasunuma
0
42
Basic method for Java EE Web Profile
khasunuma
0
19
Introduction to JCA and MDB
khasunuma
0
56
Collections Framework Begineers Guide 2
khasunuma
0
56
Introduction to Date and Time API 4
khasunuma
0
51
Other Decks in Programming
See All in Programming
『品質』という言葉が嫌いな理由
korimu
0
160
GitHub Actions × RAGでコードレビューの検証の結果
sho_000
0
260
昭和の職場からアジャイルの世界へ
kumagoro95
1
380
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
WebDriver BiDiとは何なのか
yotahada3
1
140
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
470
Amazon S3 TablesとAmazon S3 Metadataを触ってみた / 20250201-jawsug-tochigi-s3tables-s3metadata
kasacchiful
0
160
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
190
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
710
GoとPHPのインターフェイスの違い
shimabox
2
190
楽しく向き合う例外対応
okutsu
0
110
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Facilitating Awesome Meetings
lara
52
6.2k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
GitHub's CSS Performance
jonrohan
1030
460k
Automating Front-end Workflow
addyosmani
1368
200k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Typedesign – Prime Four
hannesfritz
40
2.5k
Statistics for Hackers
jakevdp
797
220k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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