SlideShare a Scribd company logo
1 of 14
Download to read offline
Kotlinv 1.1.2
Víctor Bolinches
Getting started [ 10 - 05 -2017]
2
Kotlin
Introduction
• Compilation
• IDE’s
• Project builders
• Syntax
• ¿Why Kotlin?
• Practice
• References
3
Kotlin
¿Por qué Kotlin?
Statically
typed
programming
language
(JVM 100%)
Concise Sage Versatile Interoperable Tooling
4
Kotlin
Compilation
Kotlin/JSKotlin/JVM Kotlin/Native
[ LLVM bitcode ]
5
Kotlin
IDE’s
Eclipse IntelliJ IDEA Ultimate Android Studio
6
Kotlin
Project Builders
Apache Ant Maven Gradle
7
Kotlin
• Constructors
• Functions
• Properties
• Operators, Control flow…
• Data Class
• Singleton
• Nullable values & checking
• Auto Castings
• Extension Functions
• Lambdas
Basic syntax - Kotlin/JVM
8
Kotlin
• Coding Dojo : FizzBuzz
• Level: Easy
• TDD, BabySteps
• Migration with Kotlin
• Refactorings with characteristics of Kotlin
• Example with Kotlin/JS
Practice
9
Kotlin
Practice – FizzBuzz Java
public class FizzBuzz{
public static void main(String[] args){
invoke();
}
public static void invoke(){
for(int i= 1; i <= 100; i++){
String str = "";
if(i % 3 == 0) str += "Fizz ";
if(i % 5 == 0) str += "Buzz ";
if(str.equals("")) str+= i;
System.out.print(str);
}
}
}
Result:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 … 97 98 Fizz Buzz
Time: 6,199,220 ns
10
Kotlin
Practice – FizzBuzz migrated with kotlin
object FizzBuzz {
@JvmStatic fun main(args: Array<String>) {
invoke()
}
fun invoke() {
for(i in 1..100) {
var str = “”
if(i % 3 == 0 ) str+= “Fizz”
if(i % 5 == 0 ) str+= “Buzz”
if(str == “” ) str+= i
println(str + “”)
}
}
}
Result:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 … 97 98 Fizz Buzz
Time: 3,818,510 ns
11
Kotlin
Practice – FizzBuzz Kotlin
class FizzBuzz {
@JvmStatic fun main(args: Array<String>) {
for(i in 1 .. 100)
invoke(i)
}
fun invoke(i: Int) = when {
i % 15 == 0 -> “FizzBuzz ”
i % 3 == 0 -> “Fizz ”
i % 5 == 0 -> “Buzz ”
else -> “$i “
}
Result:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 … 97 98 Fizz Buzz
Time: 1,595,322 ns
12
Kotlin
Practice – FizzBuzz Kotlin/JS
import kotlin.browser.document
fun main(args:Array <String>) {
printText("h1", { "Hello World Kotlin Java Script!" } )
printText("h6", { fizzBuzzRecursive (100) } )
}
fun printText(element: String, invoke : () -> String ) {
val h = document.createElement(element)
h.textContent = invoke()
document.body!!.appendChild(h)
}
fun fizzBuzzRecursive (i: Int ) : String {
if(i == 0 )
return ""
val str = when {
i % 15 == 0 -> "FizzBuzz "
i % 3 == 0 -> "Fizz "
i % 5 == 0 -> "Buzz "
else -> "$i n"
}
return fizzBuzzRecursive (i-1).plus(str)
}
13
Kotlin
Practice – FizzBuzz Kotlin/JS
14
Kotlin
• Kotlin
• Kotlin.es
• LLVM
• Java
• JS
• Eclipse
• Intellij
• Gradle
• Maven
Referencias
• Ant
• Android Studio
• Getting Started

More Related Content

What's hot

Introduction to Python Asyncio
Introduction to Python AsyncioIntroduction to Python Asyncio
Introduction to Python AsyncioNathan Van Gheem
 
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)Ewan Slater
 
Reactive streams and why it matters - Andrei Krichevskiy
Reactive streams and why it matters - Andrei KrichevskiyReactive streams and why it matters - Andrei Krichevskiy
Reactive streams and why it matters - Andrei KrichevskiyBol.com Techlab
 
PuppetConf 2014 Killer R10K Workflow With Notes
PuppetConf 2014 Killer R10K Workflow With NotesPuppetConf 2014 Killer R10K Workflow With Notes
PuppetConf 2014 Killer R10K Workflow With NotesPhil Zimmerman
 
マイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCマイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCdisc99_
 
Clack: glue for web apps
Clack: glue for web appsClack: glue for web apps
Clack: glue for web appsfukamachi
 
Mongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam HelmanMongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam HelmanHakka Labs
 
Guillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource APIGuillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource APINathan Van Gheem
 
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet
 
Killer R10K Workflow - PuppetConf 2014
Killer R10K Workflow - PuppetConf 2014Killer R10K Workflow - PuppetConf 2014
Killer R10K Workflow - PuppetConf 2014Puppet
 
Python的50道陰影
Python的50道陰影Python的50道陰影
Python的50道陰影Tim (文昌)
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsYoshiki Shibukawa
 
Continuous Delivery of Puppet Manifests
Continuous Delivery of Puppet ManifestsContinuous Delivery of Puppet Manifests
Continuous Delivery of Puppet ManifestsKris Buytaert
 
Using adapter in bpel process in oracle soa suite 11g
Using adapter in bpel process in oracle soa suite 11gUsing adapter in bpel process in oracle soa suite 11g
Using adapter in bpel process in oracle soa suite 11gNagaraju Kendyala
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAtlassian
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub태환 김
 

What's hot (20)

Introduction to Python Asyncio
Introduction to Python AsyncioIntroduction to Python Asyncio
Introduction to Python Asyncio
 
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)FaaS you like it (if Shakespeare had written Functions-as-a-Service)
FaaS you like it (if Shakespeare had written Functions-as-a-Service)
 
Reactive streams and why it matters - Andrei Krichevskiy
Reactive streams and why it matters - Andrei KrichevskiyReactive streams and why it matters - Andrei Krichevskiy
Reactive streams and why it matters - Andrei Krichevskiy
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
PuppetConf 2014 Killer R10K Workflow With Notes
PuppetConf 2014 Killer R10K Workflow With NotesPuppetConf 2014 Killer R10K Workflow With Notes
PuppetConf 2014 Killer R10K Workflow With Notes
 
マイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCマイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPC
 
Clack: glue for web apps
Clack: glue for web appsClack: glue for web apps
Clack: glue for web apps
 
Mongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam HelmanMongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam Helman
 
Guillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource APIGuillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource API
 
High 5 Final Presentation
High 5 Final PresentationHigh 5 Final Presentation
High 5 Final Presentation
 
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Killer R10K Workflow - PuppetConf 2014
Killer R10K Workflow - PuppetConf 2014Killer R10K Workflow - PuppetConf 2014
Killer R10K Workflow - PuppetConf 2014
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Python的50道陰影
Python的50道陰影Python的50道陰影
Python的50道陰影
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
 
Continuous Delivery of Puppet Manifests
Continuous Delivery of Puppet ManifestsContinuous Delivery of Puppet Manifests
Continuous Delivery of Puppet Manifests
 
Using adapter in bpel process in oracle soa suite 11g
Using adapter in bpel process in oracle soa suite 11gUsing adapter in bpel process in oracle soa suite 11g
Using adapter in bpel process in oracle soa suite 11g
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 

Similar to Kotlin v1.1.2

Kotlin: Why Do You Care?
Kotlin: Why Do You Care?Kotlin: Why Do You Care?
Kotlin: Why Do You Care?intelliyole
 
Boost up your productivity with Kotlin - Liferay Symposium France 2018
Boost up your productivity with Kotlin - Liferay Symposium France 2018Boost up your productivity with Kotlin - Liferay Symposium France 2018
Boost up your productivity with Kotlin - Liferay Symposium France 2018Louis-Guillaume Durand
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...tdc-globalcode
 
用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手Shengyou Fan
 
Ktor 101 (以 Ktor 實作 Website 範例)
Ktor 101 (以 Ktor 實作 Website 範例)Ktor 101 (以 Ktor 實作 Website 範例)
Ktor 101 (以 Ktor 實作 Website 範例)Shengyou Fan
 
Coroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in PractiseCoroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in PractiseChristian Melchior
 
From Java to Kotlin - The first month in practice
From Java to Kotlin - The first month in practiceFrom Java to Kotlin - The first month in practice
From Java to Kotlin - The first month in practiceStefanTomm
 
A TypeScript Fans KotlinJS Adventures
A TypeScript Fans KotlinJS AdventuresA TypeScript Fans KotlinJS Adventures
A TypeScript Fans KotlinJS AdventuresGarth Gilmour
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin PresentationAndrzej Sitek
 
Kotlin The Whole Damn Family
Kotlin The Whole Damn FamilyKotlin The Whole Damn Family
Kotlin The Whole Damn FamilyGarth Gilmour
 
Rapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorRapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorTrayan Iliev
 
Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?gedoplan
 
Kotlin for backend development (Hackaburg 2018 Regensburg)
Kotlin for backend development (Hackaburg 2018 Regensburg)Kotlin for backend development (Hackaburg 2018 Regensburg)
Kotlin for backend development (Hackaburg 2018 Regensburg)Tobias Schneck
 
fun kotlinMultiplatform()
fun kotlinMultiplatform()fun kotlinMultiplatform()
fun kotlinMultiplatform()ssuserdd678d
 
Programming with Kotlin
Programming with KotlinProgramming with Kotlin
Programming with KotlinDavid Gassner
 
Kotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a treeKotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a treeKai Koenig
 

Similar to Kotlin v1.1.2 (20)

Kotlin: Why Do You Care?
Kotlin: Why Do You Care?Kotlin: Why Do You Care?
Kotlin: Why Do You Care?
 
Kotlin
KotlinKotlin
Kotlin
 
Boost up your productivity with Kotlin - Liferay Symposium France 2018
Boost up your productivity with Kotlin - Liferay Symposium France 2018Boost up your productivity with Kotlin - Liferay Symposium France 2018
Boost up your productivity with Kotlin - Liferay Symposium France 2018
 
Kotlin 1.1
Kotlin 1.1Kotlin 1.1
Kotlin 1.1
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
 
用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手
 
Ktor 101 (以 Ktor 實作 Website 範例)
Ktor 101 (以 Ktor 實作 Website 範例)Ktor 101 (以 Ktor 實作 Website 範例)
Ktor 101 (以 Ktor 實作 Website 範例)
 
Coroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in PractiseCoroutines for Kotlin Multiplatform in Practise
Coroutines for Kotlin Multiplatform in Practise
 
From Java to Kotlin - The first month in practice
From Java to Kotlin - The first month in practiceFrom Java to Kotlin - The first month in practice
From Java to Kotlin - The first month in practice
 
Koin Quickstart
Koin QuickstartKoin Quickstart
Koin Quickstart
 
A TypeScript Fans KotlinJS Adventures
A TypeScript Fans KotlinJS AdventuresA TypeScript Fans KotlinJS Adventures
A TypeScript Fans KotlinJS Adventures
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin Presentation
 
Kotlin The Whole Damn Family
Kotlin The Whole Damn FamilyKotlin The Whole Damn Family
Kotlin The Whole Damn Family
 
Rapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorRapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and Ktor
 
Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?
 
Kotlin for backend development (Hackaburg 2018 Regensburg)
Kotlin for backend development (Hackaburg 2018 Regensburg)Kotlin for backend development (Hackaburg 2018 Regensburg)
Kotlin for backend development (Hackaburg 2018 Regensburg)
 
fun kotlinMultiplatform()
fun kotlinMultiplatform()fun kotlinMultiplatform()
fun kotlinMultiplatform()
 
Programming with Kotlin
Programming with KotlinProgramming with Kotlin
Programming with Kotlin
 
Kotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a treeKotlin Coroutines and Android sitting in a tree
Kotlin Coroutines and Android sitting in a tree
 
Kotlin meets Gadsu
Kotlin meets GadsuKotlin meets Gadsu
Kotlin meets Gadsu
 

More from Víctor Bolinches

Desarrollo multiplataforma con kotlin | UPV 2018
Desarrollo multiplataforma con kotlin  | UPV 2018Desarrollo multiplataforma con kotlin  | UPV 2018
Desarrollo multiplataforma con kotlin | UPV 2018Víctor Bolinches
 
An Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android DevelopmentAn Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android DevelopmentVíctor Bolinches
 
Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...
Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...
Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...Víctor Bolinches
 
Programación Funcional y Orientada a Objetos con Asincronismos
Programación Funcional y Orientada a Objetos con AsincronismosProgramación Funcional y Orientada a Objetos con Asincronismos
Programación Funcional y Orientada a Objetos con AsincronismosVíctor Bolinches
 
PARADIGMAS FP Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONA
PARADIGMAS FP  Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONAPARADIGMAS FP  Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONA
PARADIGMAS FP Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONAVíctor Bolinches
 
Técnicas avanzadas de programación Asíncrona - 2017
Técnicas avanzadas de programación Asíncrona - 2017Técnicas avanzadas de programación Asíncrona - 2017
Técnicas avanzadas de programación Asíncrona - 2017Víctor Bolinches
 

More from Víctor Bolinches (6)

Desarrollo multiplataforma con kotlin | UPV 2018
Desarrollo multiplataforma con kotlin  | UPV 2018Desarrollo multiplataforma con kotlin  | UPV 2018
Desarrollo multiplataforma con kotlin | UPV 2018
 
An Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android DevelopmentAn Introduction to Kotlin for Android Development
An Introduction to Kotlin for Android Development
 
Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...
Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...
Paradigma FP y OOP usando técnicas avanzadas de Programación | Programacion A...
 
Programación Funcional y Orientada a Objetos con Asincronismos
Programación Funcional y Orientada a Objetos con AsincronismosProgramación Funcional y Orientada a Objetos con Asincronismos
Programación Funcional y Orientada a Objetos con Asincronismos
 
PARADIGMAS FP Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONA
PARADIGMAS FP  Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONAPARADIGMAS FP  Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONA
PARADIGMAS FP Y OOP USANDO TÉCNICAS AVANZADAS DE PROGRAMACIÓN ASÍNCRONA
 
Técnicas avanzadas de programación Asíncrona - 2017
Técnicas avanzadas de programación Asíncrona - 2017Técnicas avanzadas de programación Asíncrona - 2017
Técnicas avanzadas de programación Asíncrona - 2017
 

Recently uploaded

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 

Recently uploaded (20)

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 

Kotlin v1.1.2

  • 1. Kotlinv 1.1.2 Víctor Bolinches Getting started [ 10 - 05 -2017]
  • 2. 2 Kotlin Introduction • Compilation • IDE’s • Project builders • Syntax • ¿Why Kotlin? • Practice • References
  • 3. 3 Kotlin ¿Por qué Kotlin? Statically typed programming language (JVM 100%) Concise Sage Versatile Interoperable Tooling
  • 5. 5 Kotlin IDE’s Eclipse IntelliJ IDEA Ultimate Android Studio
  • 7. 7 Kotlin • Constructors • Functions • Properties • Operators, Control flow… • Data Class • Singleton • Nullable values & checking • Auto Castings • Extension Functions • Lambdas Basic syntax - Kotlin/JVM
  • 8. 8 Kotlin • Coding Dojo : FizzBuzz • Level: Easy • TDD, BabySteps • Migration with Kotlin • Refactorings with characteristics of Kotlin • Example with Kotlin/JS Practice
  • 9. 9 Kotlin Practice – FizzBuzz Java public class FizzBuzz{ public static void main(String[] args){ invoke(); } public static void invoke(){ for(int i= 1; i <= 100; i++){ String str = ""; if(i % 3 == 0) str += "Fizz "; if(i % 5 == 0) str += "Buzz "; if(str.equals("")) str+= i; System.out.print(str); } } } Result: 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 … 97 98 Fizz Buzz Time: 6,199,220 ns
  • 10. 10 Kotlin Practice – FizzBuzz migrated with kotlin object FizzBuzz { @JvmStatic fun main(args: Array<String>) { invoke() } fun invoke() { for(i in 1..100) { var str = “” if(i % 3 == 0 ) str+= “Fizz” if(i % 5 == 0 ) str+= “Buzz” if(str == “” ) str+= i println(str + “”) } } } Result: 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 … 97 98 Fizz Buzz Time: 3,818,510 ns
  • 11. 11 Kotlin Practice – FizzBuzz Kotlin class FizzBuzz { @JvmStatic fun main(args: Array<String>) { for(i in 1 .. 100) invoke(i) } fun invoke(i: Int) = when { i % 15 == 0 -> “FizzBuzz ” i % 3 == 0 -> “Fizz ” i % 5 == 0 -> “Buzz ” else -> “$i “ } Result: 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 … 97 98 Fizz Buzz Time: 1,595,322 ns
  • 12. 12 Kotlin Practice – FizzBuzz Kotlin/JS import kotlin.browser.document fun main(args:Array <String>) { printText("h1", { "Hello World Kotlin Java Script!" } ) printText("h6", { fizzBuzzRecursive (100) } ) } fun printText(element: String, invoke : () -> String ) { val h = document.createElement(element) h.textContent = invoke() document.body!!.appendChild(h) } fun fizzBuzzRecursive (i: Int ) : String { if(i == 0 ) return "" val str = when { i % 15 == 0 -> "FizzBuzz " i % 3 == 0 -> "Fizz " i % 5 == 0 -> "Buzz " else -> "$i n" } return fizzBuzzRecursive (i-1).plus(str) }
  • 14. 14 Kotlin • Kotlin • Kotlin.es • LLVM • Java • JS • Eclipse • Intellij • Gradle • Maven Referencias • Ant • Android Studio • Getting Started