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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
67
Life of our small product
khasunuma
0
49
How to adapt MicroProfile API for generic Web applications
khasunuma
0
47
Overviewing Admin Console
khasunuma
0
47
Introduction to MicroProfile Metrics
khasunuma
0
74
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
88
Introduction to Date and Time API 4
khasunuma
0
88
Other Decks in Programming
See All in Programming
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
420
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
640
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
130
AIエージェントで 変わるAndroid開発環境
takahirom
2
670
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
250
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
330
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
140
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
860
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
810
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
650
How to build a perfect <img>
jonoalderson
1
5.8k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.6k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
770
Design in an AI World
tapps
1
260
Code Review Best Practice
trishagee
74
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
260
Utilizing Notion as your number one productivity tool
mfonobong
4
420
A Tale of Four Properties
chriscoyier
163
24k
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