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
26
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
39
Life of our small product
khasunuma
0
27
How to adapt MicroProfile API for generic Web applications
khasunuma
0
28
Overviewing Admin Console
khasunuma
0
27
Introduction to MicroProfile Metrics
khasunuma
0
47
Basic method for Java EE Web Profile
khasunuma
0
22
Introduction to JCA and MDB
khasunuma
0
64
Collections Framework Begineers Guide 2
khasunuma
0
62
Introduction to Date and Time API 4
khasunuma
0
58
Other Decks in Programming
See All in Programming
ワープロって実は計算機で
pepepper
2
1.3k
Android 15以上でPDFのテキスト検索を爆速開発!
tonionagauzzi
0
200
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
330
decksh - a little language for decks
ajstarks
4
21k
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
150
Flutterと Vibe Coding で個人開発!
hyshu
1
250
GitHub Copilotの全体像と活用のヒント AI駆動開発の最初の一歩
74th
7
2.5k
MCP連携で加速するAI駆動開発/mcp integration accelerates ai-driven-development
bpstudy
0
290
#QiitaBash TDDで(自分の)開発がどう変わったか
ryosukedtomita
1
360
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
800
あまり知られていない MCP 仕様たち / MCP specifications that aren’t widely known
ktr_0731
0
240
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
1
1.5k
Featured
See All Featured
Six Lessons from altMBA
skipperchong
28
3.9k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Statistics for Hackers
jakevdp
799
220k
Side Projects
sachag
455
43k
Into the Great Unknown - MozCon
thekraken
40
2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.3k
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