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
46
0
Share
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
55
Life of our small product
khasunuma
0
45
How to adapt MicroProfile API for generic Web applications
khasunuma
0
41
Overviewing Admin Console
khasunuma
0
40
Introduction to MicroProfile Metrics
khasunuma
0
63
Basic method for Java EE Web Profile
khasunuma
0
38
Introduction to JCA and MDB
khasunuma
0
91
Collections Framework Begineers Guide 2
khasunuma
0
80
Introduction to Date and Time API 4
khasunuma
0
76
Other Decks in Programming
See All in Programming
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
260
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.2k
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
170
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
150
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
270
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
220
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
130
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
920
How to stabilize UI tests using XCTest
akkeylab
0
150
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
230
PHPで TLSのプロトコルを実装してみる
higaki_program
0
730
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
120
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
230
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Mind Mapping
helmedeiros
PRO
1
140
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
130
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
For a Future-Friendly Web
brad_frost
183
10k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
800
Fireside Chat
paigeccino
42
3.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