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
Yury Camacho
June 03, 2017
Technology
0
110
Kotlin, The Force Awakens
Introduction to Kotlin language, chapter I
Yury Camacho
June 03, 2017
Tweet
Share
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
27
Google Glass KickStart
camachoyury
0
39
Other Decks in Technology
See All in Technology
単一Kubernetesクラスタで実現する AI/ML 向けクラウドサービス
pfn
PRO
0
100
『HOWはWHY WHATで判断せよ』 〜『ドメイン駆動設計をはじめよう』の読了報告と、本質への探求〜
panda728
PRO
5
2k
Black Hat USA 2025 Recap ~ クラウドセキュリティ編 ~
kyohmizu
0
550
第65回コンピュータビジョン勉強会
tsukamotokenji
0
150
AIでテストプロセスを自動化しよう251113.pdf
sakatakazunori
0
160
Introducing RFC9111 / YAPC::Fukuoka 2025
k1low
1
290
【Oracle Cloud ウェビナー】パスワードだけでは守れない時代~多要素認証で強化する企業セキュリティ~
oracle4engineer
PRO
2
100
マルチドライブアーキテクチャ: 複数の駆動力でプロダクトを前進させる
knih
0
900
Lazy Constant - finalフィールドの遅延初期化
skrb
0
230
なぜインフラコードのモジュール化は難しいのか - アプリケーションコードとの本質的な違いから考える
mizzy
55
18k
技術広報のOKRで生み出す 開発組織への価値 〜 カンファレンス協賛を通して育む学びの文化 〜 / Creating Value for Development Organisations Through Technical Communications OKRs — Nurturing a Culture of Learning Through Conference Sponsorship —
pauli
5
390
AI時代の戦略的アーキテクチャ 〜Adaptable AI をアーキテクチャで実現する〜 / Enabling Adaptable AI Through Strategic Architecture
bitkey
PRO
4
550
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Building an army of robots
kneath
306
46k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
BBQ
matthewcrist
89
9.9k
A designer walks into a library…
pauljervisheath
210
24k
Building Applications with DynamoDB
mza
96
6.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
980
The Invisible Side of Design
smashingmag
302
51k
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