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入門
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Fukui Atsuko
May 30, 2018
Technology
3
1.5k
こんな時どう書くの? 逆引きKotlin入門
2018/5/30 に開催される「Kotlin愛好会 vol1」向けの登壇資料です。
Kotlin初心者の方を対象に、逆引きのreferenceになるようなお話をします。
Fukui Atsuko
May 30, 2018
Tweet
Share
More Decks by Fukui Atsuko
See All by Fukui Atsuko
Kotlin導入作戦
muumuumuumuu
4
570
KotlinとReduxをAndroidアプリに導入したら
muumuumuumuu
6
4.7k
Sometimes Swift confuses Kotlin engineers.
muumuumuumuu
0
680
How to find problem causes and performance improvement
muumuumuumuu
6
4.3k
Other Decks in Technology
See All in Technology
AWS Network Firewall Proxyを触ってみた
nagisa53
1
250
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
620
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
770
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
680
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
260
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
210
今こそ学びたいKubernetesネットワーク ~CNIが繋ぐNWとプラットフォームの「フラッと」な対話
logica0419
5
510
Red Hat OpenStack Services on OpenShift
tamemiya
0
140
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
480
(技術的には)社内システムもOKなブラウザエージェントを作ってみた!
har1101
0
330
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.4k
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.2k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
150
4 Signs Your Business is Dying
shpigford
187
22k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
440
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
79
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
290
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
110
RailsConf 2023
tenderlove
30
1.3k
The Spectacular Lies of Maps
axbom
PRO
1
530
Transcript
͜Μͳ࣌Ͳ͏ॻ͘ͷʁ ٯҾ͖Kotlinೖ 2018/5/30 KotlinѪձ vol1 Atsuko FUKUI
Agenda • ࣗݾհ • ຊͷΰʔϧ • ͜Μͳ࣌Ͳ͏ॻ͘ͷʁٯҾ͖Kotlinೖ • ·ͱΊ
ࣗݾհ • Ҫರࢠ / Fukui Atsuko • @muumuumuumuu • Android
Developer • Mercari, Inc.
ຊͷΰʔϧ • ؾܰʹKotlinΛॻ͖࢝ΊΒΕΔΑ͏ʹٯҾ͖ͷ ReferenceΛఏڙ͢Δ • Kotlinॳ৺ऀ͚Λఆ • Kotlin͢Ͱʹॻ͖ͳΕ͍ͯΔਓʮΘ͔Δʯ ʮKotlin͔Θ͍͍ʯͱࢥ͍ͳ͕Βฉ͍͍ͯͯԼ͞ ͍
• #love_kotlin ͷϋογϡλά͋Γ·͢Αʂ
͜Μͳ࣌Ͳ͏ॻ͘ͷʁ ٯҾ͖Kotlinೖ
มͷએݴ(1/3) • val / var म০ࢠͰม͕એݴͰ͖Δ • valfinal, var࠶ೖՄ
มͷએݴ(2/3) • ܕਪΛαϙʔτ • Φϓγϣφϧ • ܕͷએݴ࣌ʹ໌ࣔతʹ?Λ͚ͭͳ͍ͱnullΛ ڐ༰͠ͳ͍
มͷએݴ(3/3) • Ϋϥεʹଐ͢Δඞཁͳ͍(= ୈ1ڃΦϒδΣ Ϋτͱͯ͠એݴͰ͖Δ) • ఆʹconst
ؔͷએݴ(1/2) • funम০ࢠͰ͕ؔએݴͰ͖Δ • ҾͱΓͷࢦఆҎԼͷ௨Γ • த͕1ߦͰ͔͚Δ߹=Ͱܨ͛ͯreturnΛ লུͰ͖Δ
ؔͷએݴ(2/2) • σϑΥϧτҾͱ໊લ͖ҾΛαϙʔτ
݅ࣜ if (1/3) • Kotlinʹ͓͍ͯifࣜ(expression) • จ(statement)Ͱͳ͍ • ͭ·ΓΛฦ͢͜ͱ͕Ͱ͖Δ
݅ࣜ if (2/3) • ʢ೦ͳ͕Βʣࡾ߲ԋࢉࢠαϙʔτ͞Εͯ ͍ͳ͍ • ΤϧϏεԋࢉࢠ( ?: )αϙʔτ͞Ε͍ͯΔ
݅ࣜ if (3/3) • null νΣοΫείʔϓؔͱΦϓγϣφϧ ͷΈ߹Θ͕ͤΑ͘ΘΕΔ
݅ࣜ when (1/2) • if ಉ༷ʹwhenࣜ • whenͷޙΖͷ()ͷ͕ൺֱͷରʹͳΔ
݅ࣜ when (2/2) • whenͷޙΖͷ() ͳͯ͘OK • ൺֱରͷ͕ෳ͋Δ߹ʹศར
·ͱΊ
·ͱΊ • มͷએݴɺؔͷએݴɺ݅ࣜ • Kotlin͔Θ͍͍ʂʂ
͋Γ͕ͱ͏͍͟͝·ͨ͠