SlideShare a Scribd company logo
1 of 25
Download to read offline
An Introduction
to Kotlin JVM language
Andrius Klimavičius
Intro
• JVM language
• Android and browser support.
• Developed by JetBrains
• Open Source
• First appeared in 2011
• Still in Beta (v1.0.0-beta-3595)
Kotlin
google: kotlin logo
Modern Language for
Industry
• 100% interoperable with Java
• Concise - no boilerplate code
• Safe - convert runtime errors into compile time
• Tools support (command-line, plugins)
• Targets Java 6
Comparison
• Runtime error -> Compile time errors
Kotlin addresses Java
problems
• Null references are controlled by the type system.
• No raw types
• Arrays in Kotlin are invariant
• Kotlin has proper function types, as opposed to Java’s
SAM-conversions
• Kotlin does not have checked exceptions
• Use-site variance without wildcards (<? extends T>)
Kotlin vs Java
• No checked exceptions
• No primitive types that are not classes
• No static members
• No non-private fields
• No wildcard-types
Kotlin vs Java (2)
• Function literals + Inline
functions
• Extension functions
• Null-safety
• Smart casts
• String templates
• Properties
• First-class delegation
• Type inference
• Singletons
• Range expressions
• Operator overloading
• Companion objects
Features
• String templates
• Named arguments & defaults (verbose code)
• Lambda expressions
• Null-Safety (nullable, non-nullable refs)
• Functional programming methods (filter,map,…)
• Extensions (like Objective-C, C#)
• Auto generated POJOs (data class)
Features (2)
• Destructuring Declarations
• Generics (Java)
• Ranges
• Operator Overloading
• Optional semi-colons
• Android support
• ….
Hello World!
Variables
String templates
String templates
Functions
Named params & defaults
Lambda expressions
Null-safety
Basic FP methods like
filtering
Extensions
Data classes
Smart Casts
Call Java from Kotlin
println("Code in Kotlin")
Call Kotlin from Java
Reference
• https://kotlinlang.org
• https://prezi.com/5krzwy15ixea/kotlin-on-
android-mobiconf-2015/

More Related Content

What's hot

使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架
jeffz
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming Patterns
Vasil Remeniuk
 

What's hot (20)

Introduction to Kotlin coroutines
Introduction to Kotlin coroutinesIntroduction to Kotlin coroutines
Introduction to Kotlin coroutines
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
 
Introduction to Kotlin for Java developer
Introduction to Kotlin for Java developerIntroduction to Kotlin for Java developer
Introduction to Kotlin for Java developer
 
Kotlin from-scratch
Kotlin from-scratchKotlin from-scratch
Kotlin from-scratch
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架
 
Say Goodbye To Java: Getting Started With Kotlin For Android Development
Say Goodbye To Java: Getting Started With Kotlin For Android DevelopmentSay Goodbye To Java: Getting Started With Kotlin For Android Development
Say Goodbye To Java: Getting Started With Kotlin For Android Development
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
 
From V8 to Modern Compilers
From V8 to Modern CompilersFrom V8 to Modern Compilers
From V8 to Modern Compilers
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCL
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
 
Eclipse OCL Summary
Eclipse OCL SummaryEclipse OCL Summary
Eclipse OCL Summary
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming Patterns
 
Neodev
NeodevNeodev
Neodev
 
Kotlin a problem solver - gdd extended pune
Kotlin   a problem solver - gdd extended puneKotlin   a problem solver - gdd extended pune
Kotlin a problem solver - gdd extended pune
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
 
Should i Go there
Should i Go thereShould i Go there
Should i Go there
 
From Ruby to Scala
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scala
 
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
 
Introduction to Type Level Programming
Introduction to Type Level ProgrammingIntroduction to Type Level Programming
Introduction to Type Level Programming
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 

Similar to Introduction to Kotlin JVM language

Similar to Introduction to Kotlin JVM language (20)

DevNight #1 (Kotlin) @ The Brick Space
DevNight #1 (Kotlin) @ The Brick SpaceDevNight #1 (Kotlin) @ The Brick Space
DevNight #1 (Kotlin) @ The Brick Space
 
Why Kotlin?
Why Kotlin?Why Kotlin?
Why Kotlin?
 
Kotlin
KotlinKotlin
Kotlin
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Online Training.pdf
Kotlin Online Training.pdfKotlin Online Training.pdf
Kotlin Online Training.pdf
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 
Kotlin
KotlinKotlin
Kotlin
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 
What's new with Kotlin - Google IO18' extended Covenant University.
What's new with Kotlin - Google IO18' extended Covenant University.What's new with Kotlin - Google IO18' extended Covenant University.
What's new with Kotlin - Google IO18' extended Covenant University.
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
 
Getting Started With Kotlin
Getting Started With KotlinGetting Started With Kotlin
Getting Started With Kotlin
 
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Introduction to Kotlin JVM language