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
Kotlin puzzler
Search
Gorita
March 17, 2019
Programming
0
92
Kotlin puzzler
interesting kotlin language quiz.
Gorita
March 17, 2019
Tweet
Share
More Decks by Gorita
See All by Gorita
Advanced MVP(refactoring MVP)
gorita
0
260
Other Decks in Programming
See All in Programming
組織で育むオブザーバビリティ
ryota_hnk
0
170
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
270
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
ThorVG Viewer In VS Code
nors
0
770
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
AI巻き込み型コードレビューのススメ
nealle
1
160
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.5k
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Grafana:建立系統全知視角的捷徑
blueswen
0
330
Data-Centric Kaggle
isax1015
2
770
AtCoder Conference 2025
shindannin
0
1.1k
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
200
New Earth Scene 8
popppiees
1
1.5k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Prompt Engineering for Job Search
mfonobong
0
160
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
84
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
700
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Transcript
Kotlin Puzzler to help your “Huh?” situations PARK MIREUK
This session is 7 puzzles 01 1min ~ 1.5min to
solve 02 interpretation 03 https://goo.gl/ejrMtw
Purpose -Not a test -Save your debugging time -To understand
kotlin language -For fun (remember easily) Before.. https://goo.gl/ejrMtw
My BankAccount 01
result: 1. a and b is equal:true 2. a and
b is equal:false https://goo.gl/ejrMtw
result: 1. a and b is equal:true 2. a and
b is equal:false https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
The compiler automatically derives the following members from all properties
declared in the primary constructor: - equals(), hashCode(), toString(), componentN(), copy() https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Engineer’s lover 02
result: 1. There is no lover. 2. Soo:null 3. nothing
https://goo.gl/ejrMtw
result: 1. There is no lover. 2. Soo:null 3. nothing
https://goo.gl/ejrMtw
“I don’t know…maybe ?.let doing something..” Why?? https://goo.gl/ejrMtw
Let’s talk about ?.let Use ‘?.let’ for null check? •
Yes, you can. https://goo.gl/ejrMtw
Let’s talk about ?.let Use ‘?.let’ for null check? •
Yes, you can. • But, checking null works with safe call ?. not related with let https://goo.gl/ejrMtw
Let’s talk about ?.let let, run, also, apply . •
Expression • Scope https://goo.gl/ejrMtw
Let’s talk about ?.let let, run, also, apply . •
Expression • Opposite of Statement • Has returns • Scope https://goo.gl/ejrMtw
Let’s talk about ?.let let, run, also, apply . •
Expression • Opposite of Statement • Has returns • Scope https://goo.gl/ejrMtw
result: 1. There is no lover. 2. Soo:null 3. nothing
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
If the expression to the left of ?: is not
null, the elvis operator returns it, otherwise it returns the expression to the right. Execute expression to the left of ?: is null, Not ‘james.lover’ is null https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Execute expression to the left of ?: is null https://goo.gl/ejrMtw
Easy Book 03
result: 1. hasAuthorName:true 2. hasAuthorName:false https://goo.gl/ejrMtw
result: 1. hasAuthorName:true 2. hasAuthorName:false https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Need to check operator != first. Left expression of !=
and right expression of !=. https://goo.gl/ejrMtw
No account, No password 04
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
null “null” https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
My name is 05
result: 1. Hello, my name is james 2. Hello, my
name is 3. nothing https://goo.gl/ejrMtw
result: 1. Hello, my name is james 2. Hello, my
name is 3. nothing https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Compile error https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Memo 06
result: 1. pass 2. fail https://goo.gl/ejrMtw
result: 1. pass 2. fail https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
junit assert kotlin assert$ https://goo.gl/ejrMtw
% “write failing test first” remember https://goo.gl/ejrMtw
Be our guest 07
result: https://goo.gl/ejrMtw
result: 1:6, 2:6 3:6, 4:7, 5:7 6:6, 7:8, 9:7
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
1. Same as java final https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
2. Hire at least two.. https://goo.gl/ejrMtw
Thank You
Thank You