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
40
Other Decks in Technology
See All in Technology
AI駆動開発を事業のコアに置く
tasukuonizawa
1
290
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
93k
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
170
What happened to RubyGems and what can we learn?
mikemcquaid
0
310
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
200
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
220
Red Hat OpenStack Services on OpenShift
tamemiya
0
120
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
590
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
160
20260204_Midosuji_Tech
takuyay0ne
1
160
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
350
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
[SF Ruby Conf 2025] Rails X
palkan
1
760
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
How GitHub (no longer) Works
holman
316
140k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
The Curse of the Amulet
leimatthew05
1
8.7k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
76
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
100
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