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, The Force Awakens
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yury Camacho
June 03, 2017
Technology
110
0
Share
Kotlin, The Force Awakens
Introduction to Kotlin language, chapter I
Yury Camacho
June 03, 2017
More Decks by Yury Camacho
See All by Yury Camacho
Flutter 101
camachoyury
0
230
Programacion
camachoyury
0
110
Kotlin for Android Developers
camachoyury
0
140
Android Wear
camachoyury
0
31
Google Glass KickStart
camachoyury
0
43
Other Decks in Technology
See All in Technology
(きっとたぶん)人材育成や教育のような何かの話
sejima
0
600
巨大プラットフォームを進化させる「第3のROI」
recruitengineers
PRO
2
2.4k
要件定義の精度を高めるための型と生成AIの活用 / Using Types and Generative AI to Improve the Accuracy of Requirements Definition
haru860
0
290
[Scram Fest Niigata2026]Quality as Code〜AIにQAの思考を再現させる試み〜
masamiyajiri
1
230
Agent の「自由」と「安全」〜未来に向けて今できること〜
katayan
0
330
AIの揺らぎに“コシ”を与える階層化品質設計
ickx
0
220
EMから幅を広げるために最近挑戦していること / Recent challenges I'm undertaking to expand my horizons beyond EM
hiro_torii
1
180
20260513_生成AIを専属DSに_AI分析結果の検品テクニック_ハンズオン_交通事故データ
doradora09
PRO
0
180
世界の中心でApp Runnerを叫ぶ FINAL
tsukuboshi
0
230
UIライブラリに依存しすぎないReact Native設計を目指して
grandbig
0
190
雑談は、センサーだった
bitkey
PRO
2
200
Reasoning Models in Practice: From Inference- Time to Training-Time Scaling on Verifiable Tasks
nptdat
0
110
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
170
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
BBQ
matthewcrist
89
10k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
320
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Paper Plane (Part 1)
katiecoart
PRO
0
7.1k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Faster Mobile Websites
deanohume
310
31k
Transcript
Kotlin The Force Awakens @camachoyury
None
Android official support Kotlin
What is Kotlin? • JVM • Seems like Java •
Object Oriented • Functional • Less code than Java • No need Classes • Null safety
No need Classes fun main(args: Array<String>){ println("be the force with
you") }
Variables y mutability val name: String = "Kylo Ren" var
side = "Force" side = "Dark Side" name = "Kylo" //no compile!!!
Template String fun activateSable(color: String){ println("${color} Sable activate!!" ) }
“If” is so cool! var sable = true; println( if
(sable) { "Activate" }else { "Deactivated" })
Null Safety // error no compile var clone: String =
null //can not be a value of a non-null type String // could be null var clone2: String? = null clone2 = "clone" // I’m sure, clone2 is not null println( clone2!! )
Functions Extension functions
Functions • No need to be part of a class
• “fun” keyword for create a function • Default parameters • Named Parameters • Extension functions
Functions in kotlin fun sableActivated(character: Character) :Boolean { character.sable }
Default parameters class Character(name: String, sable: Boolean = false ){
val name = name; var sable = sable }
Named parameters var kylo = Character( sable = true, name
= "Kylo Ren")
Extension functions fun Character.showup(){ println(this.name) println( if (this.sable){ "Has sable"
}else "No sable" ) }
Extension functions fun String.printYourSelf(){ println(this) } "Force be with you".printYourSelf()
Infix functions infix fun Character.fight(character: Character){ println("fight beginig ${this.name} and
${character.name} ") } kylo fight rey
Clases class Character(name: String, sable:Boolean ){ val name = name;
var sable = sable }
Herencia open data class Character(var name: String, var sable:Boolean =
false ){ } class SecCharacter(name: String) : Character(name){ }
Bye bye POJO data class Character(var nombre: String, var sable:Boolean
= false ){} //function by default kylo.toString() kylo.hashCode() kylo.equals() //setters and getters by default kylo.name kylo.sable
Questions?
https://kotlinlang.org https://antonioleiva.com/ Links reference
None