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
27
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
40
Life of our small product
khasunuma
0
28
How to adapt MicroProfile API for generic Web applications
khasunuma
0
29
Overviewing Admin Console
khasunuma
0
28
Introduction to MicroProfile Metrics
khasunuma
0
48
Basic method for Java EE Web Profile
khasunuma
0
24
Introduction to JCA and MDB
khasunuma
0
66
Collections Framework Begineers Guide 2
khasunuma
0
63
Introduction to Date and Time API 4
khasunuma
0
60
Other Decks in Programming
See All in Programming
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
130
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
1
430
開発生産性を上げるための生成AI活用術
starfish719
3
450
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
120
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
100
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
1k
CSC509 Lecture 06
javiergs
PRO
0
260
ALL CODE BASE ARE BELONG TO STUDY
uzulla
1
110
Your Perfect Project Setup for Angular @BASTA! 2025 in Mainz
manfredsteyer
PRO
0
160
明日から始めるリファクタリング
ryounasso
0
130
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
160
私はどうやって技術力を上げたのか
yusukebe
43
18k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
114
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Unsuck your backbone
ammeep
671
58k
It's Worth the Effort
3n
187
28k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.7k
Git: the NoSQL Database
bkeepers
PRO
431
66k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
189
55k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
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