SlideShare a Scribd company logo
1 of 64
Download to read offline
Statically typed programming language
for the JVM, Android and the browser
100% interoperable with Java™
PaymentRobot payment = new PaymentRobot();
ResultRobot result = payment
.amount(42_00)
.recipient("foo@bar.com")
.send();
result.isSuccess();
val payment = PaymentRobot()
val result = payment
.amount(4200)
.recipient("foo@bar.com")
.send()
result.isSuccess()
val result = payment {
amount(4200)
recipient("foo@bar.com")
}.send()
result.isSuccess()
payment {
amount(4200)
recipient("foo@bar.com")
}.send {
isSuccess()
}
payment {
amount(4200)
recipient("foo@bar.com")
} send {
isSuccess()
}
payment {
amount(4200)
recipient("foo@bar.com")
send()
}
birthday {
date(1970, 1, 1)
next()
}
ssn {
value("123-56-7890")
next()
}
result {
isSuccess()
}
public String foo() {

...

}
// null or non-null?

String f = foo();
@NonNull
public String foo() {

...

}
// non-null

String f = foo();
// nullable

fun nullable(): String? {

...

}



// non-null

fun nonNull(): String {

...

}
// ok

val foo: String? = "foo"



// compile error

val bar: String = null
String foo = "foo";

String bar = "foo";

// isEquals: true
boolean isEquals = foo.equals(bar);
String foo = "foo";

String bar = "foo";



// isEquals: false
boolean isEquals = foo == bar;
val foo = "foo"

val bar = "bar"



// isEquals: true
val isEquals = foo == bar
// MyFunctions.kt



package com.sample.package



fun foo() { }
// OtherFunctions.kt

package com.sample.package.others

// import function foo()

import com.sample.package.foo



fun baz() {

foo()

}
public class MainActivity extends AppCompatActivity {



Button btnCalligraphy;



@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);



btnCalligraphy = (Button) findViewById(R.id.btn_calligraphy);



btnCalligraphy.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

// Do something

}

});



}

}
class MainActivity : AppCompatActivity() {



override fun onCreate(savedInstanceState: Bundle?) {

super.onCreate(savedInstanceState)

setContentView(R.layout.activity_main)



btn_calligraphy.setOnClickListener {

// Do something

}

}

}
view.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Toast.makeText(
v.getContext().getApplicationContext(),

"Hello", Toast.LENGTH_SHORT).show();

}

});
view.setOnClickListener({ v ->



Toast.makeText(v.context.applicationContext,

"Hello", Toast.LENGTH_SHORT).show()



})
view.setOnClickListener { v ->



Toast.makeText(v.context.applicationContext,

"Hello", Toast.LENGTH_SHORT).show()



}
view.setOnClickListener {



Toast.makeText(it.context.applicationContext,

"Hello", Toast.LENGTH_SHORT).show()



}
val people : List<String> = ..


people.filter { it.startsWith('S') }

.filter { it.length < 10 }

.onEach { it.toUpperCase() }

.forEach { println(it) }
val people : List<String> = ..


people.filter { it.startsWith('S') }

.filter { it.length < 10 }

.onEach(String::toUpperCase)

.forEach(::println)
val people : List<String> = ..


people.stream()

.filter { it.startsWith('S') }

.filter { it.length < 10 }

.map(String::toUpperCase)

.forEach(::println)
var foo : String = "Foo"

foo = "FOO"



val bar : String = "Bar"

bar = "BAR"
var foo : String = "Foo"

foo = "FOO"



val bar : String = "Bar"

bar = "BAR"
Compile Error (val cannot be reassigned)
val mutableList : MutableList<String>
= mutableListOf(“foo", "bar", "baz")

mutableList.add("fizz")



val immutableList : List<String>
= listOf("foo", "bar", "baz")

immutableList.add("fizz")
val mutableList : MutableList<String>
= mutableListOf("foo", "bar", "baz")

mutableList.add("fizz")



val immutableList : List<String>
= listOf("foo", "bar", "baz")

immutableList.add("fizz")
Compile Error (val cannot be reassigned)
val emptyStringList = listOf<String>()



val cities = listOf("Seoul", "Busan")



val mutableCities = mutableListOf("Seoul, Busan")
val emptyStringSet = setOf<String>()



val cities = setOf("Seoul", "Busan")



val mutableCities = mutableSetOf("Seoul, Busan")
val pair : Pair<String, String> = Pair("Seoul", "서울")
val pair : Pair<String, String> = "Seoul" to "서울"
public class Person {



String name;



String address;



Person(String name, String address) {

this.name = name;

this.address = address;

}



public String getAddress() {

return address;

}



public void setAddress(String address) {

this.address = address;

}

}
public class Person {



String name;



String address;



Person(String name, String address) {

this.name = name;

this.address = address;

}



public String getAddress() {

return address;

}



public void setAddress(String address) {

this.address = address;

}



@Override

public boolean equals(Object o) {

if (this == o) {

return true;

}

if (o == null || getClass() != o.getClass()) {

return false;

}



Person person = (Person) o;



if (!name.equals(person.name)) {

return false;

}

return address != null ? address.equals(person.address) : person.address == null;



}



@Override

public int hashCode() {

int result = name.hashCode();

result = 31 * result + (address != null ? address.hashCode() : 0);

return result;

}



@Override

data class Person(val name: String, val address: String)
Toast.makeText(applicationContext,
"Hello, Kotlin!", Toast.LENGTH_SHORT).show()
// Define an extension function on Context
fun Context.toast(message: String) {

Toast.makeText(this.applicationContext,
message, Toast.LENGTH_SHORT).show()

}
// available in class Context and its descendants
toast("Hello, Kotlin!")
Happy Kotlin!

More Related Content

What's hot

The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212Mahmoud Samir Fayed
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackVic Metcalfe
 
Python Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit TestingPython Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit TestingPython Ireland
 
JavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauJavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauReact London 2017
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1Ke Wei Louis
 
The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88Mahmoud Samir Fayed
 
Effector: we need to go deeper
Effector: we need to go deeperEffector: we need to go deeper
Effector: we need to go deeperVictor Didenko
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기JangHyuk You
 
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181Mahmoud Samir Fayed
 
Mongodb Aggregation Pipeline
Mongodb Aggregation PipelineMongodb Aggregation Pipeline
Mongodb Aggregation Pipelinezahid-mian
 
大量地区化解决方案V5
大量地区化解决方案V5大量地区化解决方案V5
大量地区化解决方案V5bqconf
 
Useful javascript
Useful javascriptUseful javascript
Useful javascriptLei Kang
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherIvano Malavolta
 
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)MongoSF
 
Derping With Kotlin
Derping With KotlinDerping With Kotlin
Derping With KotlinRoss Tuck
 
Using a mobile phone as a therapist - Superweek 2018
Using a mobile phone as a therapist - Superweek 2018Using a mobile phone as a therapist - Superweek 2018
Using a mobile phone as a therapist - Superweek 2018Peter Meyer
 

What's hot (20)

The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212
 
ProgrammingwithGOLang
ProgrammingwithGOLangProgrammingwithGOLang
ProgrammingwithGOLang
 
Intro to F#
Intro to F#Intro to F#
Intro to F#
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
 
Python Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit TestingPython Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit Testing
 
JavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauJavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher Chedeau
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1
 
The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88
 
Effector: we need to go deeper
Effector: we need to go deeperEffector: we need to go deeper
Effector: we need to go deeper
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
 
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181
 
Mongodb Aggregation Pipeline
Mongodb Aggregation PipelineMongodb Aggregation Pipeline
Mongodb Aggregation Pipeline
 
大量地区化解决方案V5
大量地区化解决方案V5大量地区化解决方案V5
大量地区化解决方案V5
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 Refresher
 
Table through php
Table through phpTable through php
Table through php
 
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
 
Derping With Kotlin
Derping With KotlinDerping With Kotlin
Derping With Kotlin
 
Introduction to Go for Java Programmers
Introduction to Go for Java ProgrammersIntroduction to Go for Java Programmers
Introduction to Go for Java Programmers
 
Using a mobile phone as a therapist - Superweek 2018
Using a mobile phone as a therapist - Superweek 2018Using a mobile phone as a therapist - Superweek 2018
Using a mobile phone as a therapist - Superweek 2018
 

Similar to 레진코믹스가 코틀린으로 간 까닭은?

Kotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in KotlinKotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in KotlinJetBrains Russia
 
A swift introduction to Swift
A swift introduction to SwiftA swift introduction to Swift
A swift introduction to SwiftGiordano Scalzo
 
Java/Scala Lab: Slava Schmidt - Introduction to Reactive Streams
Java/Scala Lab: Slava Schmidt - Introduction to Reactive StreamsJava/Scala Lab: Slava Schmidt - Introduction to Reactive Streams
Java/Scala Lab: Slava Schmidt - Introduction to Reactive StreamsGeeksLab Odessa
 
Error Handling with the Result Monad
Error Handling with the Result MonadError Handling with the Result Monad
Error Handling with the Result Monadistefo
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kirill Rozov
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Suyeol Jeon
 
Kotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan SoaresKotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan SoaresiMasters
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)William Narmontas
 
JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011Stephen Chin
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?Nikita Popov
 
かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版Yutaka Kato
 
Introduction to Swift programming language.
Introduction to Swift programming language.Introduction to Swift programming language.
Introduction to Swift programming language.Icalia Labs
 

Similar to 레진코믹스가 코틀린으로 간 까닭은? (17)

Kotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in KotlinKotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
 
Miracle of std lib
Miracle of std libMiracle of std lib
Miracle of std lib
 
Pooya Khaloo Presentation on IWMC 2015
Pooya Khaloo Presentation on IWMC 2015Pooya Khaloo Presentation on IWMC 2015
Pooya Khaloo Presentation on IWMC 2015
 
A swift introduction to Swift
A swift introduction to SwiftA swift introduction to Swift
A swift introduction to Swift
 
Java/Scala Lab: Slava Schmidt - Introduction to Reactive Streams
Java/Scala Lab: Slava Schmidt - Introduction to Reactive StreamsJava/Scala Lab: Slava Schmidt - Introduction to Reactive Streams
Java/Scala Lab: Slava Schmidt - Introduction to Reactive Streams
 
Error Handling with the Result Monad
Error Handling with the Result MonadError Handling with the Result Monad
Error Handling with the Result Monad
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2
 
Kotlin, why?
Kotlin, why?Kotlin, why?
Kotlin, why?
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
 
Benefits of Kotlin
Benefits of KotlinBenefits of Kotlin
Benefits of Kotlin
 
ddd+scala
ddd+scaladdd+scala
ddd+scala
 
Kotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan SoaresKotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan Soares
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)
 
JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?
 
かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版
 
Introduction to Swift programming language.
Introduction to Swift programming language.Introduction to Swift programming language.
Introduction to Swift programming language.
 

More from Taeho Kim

RxJava in Action
RxJava in ActionRxJava in Action
RxJava in ActionTaeho Kim
 
Android Studio 2.2 - What's new in Android development tools
Android Studio 2.2 - What's new in Android development toolsAndroid Studio 2.2 - What's new in Android development tools
Android Studio 2.2 - What's new in Android development toolsTaeho Kim
 
Multi Window in Android N
Multi Window in Android NMulti Window in Android N
Multi Window in Android NTaeho Kim
 
Material Design with Support Design Library
Material Design with Support Design LibraryMaterial Design with Support Design Library
Material Design with Support Design LibraryTaeho Kim
 
Support Design Library
Support Design LibrarySupport Design Library
Support Design LibraryTaeho Kim
 
Material design for everyone
Material design for everyoneMaterial design for everyone
Material design for everyoneTaeho Kim
 
Notifications for Android L & wear
Notifications for Android L & wearNotifications for Android L & wear
Notifications for Android L & wearTaeho Kim
 
[Hello World 천안아산] 안드로이드 입문
[Hello World 천안아산] 안드로이드 입문[Hello World 천안아산] 안드로이드 입문
[Hello World 천안아산] 안드로이드 입문Taeho Kim
 

More from Taeho Kim (8)

RxJava in Action
RxJava in ActionRxJava in Action
RxJava in Action
 
Android Studio 2.2 - What's new in Android development tools
Android Studio 2.2 - What's new in Android development toolsAndroid Studio 2.2 - What's new in Android development tools
Android Studio 2.2 - What's new in Android development tools
 
Multi Window in Android N
Multi Window in Android NMulti Window in Android N
Multi Window in Android N
 
Material Design with Support Design Library
Material Design with Support Design LibraryMaterial Design with Support Design Library
Material Design with Support Design Library
 
Support Design Library
Support Design LibrarySupport Design Library
Support Design Library
 
Material design for everyone
Material design for everyoneMaterial design for everyone
Material design for everyone
 
Notifications for Android L & wear
Notifications for Android L & wearNotifications for Android L & wear
Notifications for Android L & wear
 
[Hello World 천안아산] 안드로이드 입문
[Hello World 천안아산] 안드로이드 입문[Hello World 천안아산] 안드로이드 입문
[Hello World 천안아산] 안드로이드 입문
 

Recently uploaded

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 

Recently uploaded (20)

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 

레진코믹스가 코틀린으로 간 까닭은?

  • 1.
  • 2.
  • 3.
  • 4. Statically typed programming language for the JVM, Android and the browser 100% interoperable with Java™
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. PaymentRobot payment = new PaymentRobot(); ResultRobot result = payment .amount(42_00) .recipient("foo@bar.com") .send(); result.isSuccess();
  • 13. val payment = PaymentRobot() val result = payment .amount(4200) .recipient("foo@bar.com") .send() result.isSuccess()
  • 14. val result = payment { amount(4200) recipient("foo@bar.com") }.send() result.isSuccess()
  • 17. payment { amount(4200) recipient("foo@bar.com") send() } birthday { date(1970, 1, 1) next() } ssn { value("123-56-7890") next() } result { isSuccess() }
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. public String foo() {
 ...
 } // null or non-null?
 String f = foo();
  • 25. @NonNull public String foo() {
 ...
 } // non-null
 String f = foo();
  • 26. // nullable
 fun nullable(): String? {
 ...
 }
 
 // non-null
 fun nonNull(): String {
 ...
 }
  • 27. // ok
 val foo: String? = "foo"
 
 // compile error
 val bar: String = null
  • 28. String foo = "foo";
 String bar = "foo";
 // isEquals: true boolean isEquals = foo.equals(bar);
  • 29. String foo = "foo";
 String bar = "foo";
 
 // isEquals: false boolean isEquals = foo == bar;
  • 30. val foo = "foo"
 val bar = "bar"
 
 // isEquals: true val isEquals = foo == bar
  • 31.
  • 33. // OtherFunctions.kt
 package com.sample.package.others
 // import function foo()
 import com.sample.package.foo
 
 fun baz() {
 foo()
 }
  • 34.
  • 35.
  • 36. public class MainActivity extends AppCompatActivity {
 
 Button btnCalligraphy;
 
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 
 btnCalligraphy = (Button) findViewById(R.id.btn_calligraphy);
 
 btnCalligraphy.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View view) {
 // Do something
 }
 });
 
 }
 }
  • 37. class MainActivity : AppCompatActivity() {
 
 override fun onCreate(savedInstanceState: Bundle?) {
 super.onCreate(savedInstanceState)
 setContentView(R.layout.activity_main)
 
 btn_calligraphy.setOnClickListener {
 // Do something
 }
 }
 }
  • 38. view.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View v) {
 Toast.makeText( v.getContext().getApplicationContext(),
 "Hello", Toast.LENGTH_SHORT).show();
 }
 });
  • 40. view.setOnClickListener { v ->
 
 Toast.makeText(v.context.applicationContext,
 "Hello", Toast.LENGTH_SHORT).show()
 
 }
  • 42. val people : List<String> = .. 
 people.filter { it.startsWith('S') }
 .filter { it.length < 10 }
 .onEach { it.toUpperCase() }
 .forEach { println(it) }
  • 43. val people : List<String> = .. 
 people.filter { it.startsWith('S') }
 .filter { it.length < 10 }
 .onEach(String::toUpperCase)
 .forEach(::println)
  • 44. val people : List<String> = .. 
 people.stream()
 .filter { it.startsWith('S') }
 .filter { it.length < 10 }
 .map(String::toUpperCase)
 .forEach(::println)
  • 45. var foo : String = "Foo"
 foo = "FOO"
 
 val bar : String = "Bar"
 bar = "BAR"
  • 46. var foo : String = "Foo"
 foo = "FOO"
 
 val bar : String = "Bar"
 bar = "BAR" Compile Error (val cannot be reassigned)
  • 47. val mutableList : MutableList<String> = mutableListOf(“foo", "bar", "baz")
 mutableList.add("fizz")
 
 val immutableList : List<String> = listOf("foo", "bar", "baz")
 immutableList.add("fizz")
  • 48. val mutableList : MutableList<String> = mutableListOf("foo", "bar", "baz")
 mutableList.add("fizz")
 
 val immutableList : List<String> = listOf("foo", "bar", "baz")
 immutableList.add("fizz") Compile Error (val cannot be reassigned)
  • 49.
  • 50.
  • 51. val emptyStringList = listOf<String>()
 
 val cities = listOf("Seoul", "Busan")
 
 val mutableCities = mutableListOf("Seoul, Busan")
  • 52. val emptyStringSet = setOf<String>()
 
 val cities = setOf("Seoul", "Busan")
 
 val mutableCities = mutableSetOf("Seoul, Busan")
  • 53. val pair : Pair<String, String> = Pair("Seoul", "서울")
  • 54. val pair : Pair<String, String> = "Seoul" to "서울"
  • 55. public class Person {
 
 String name;
 
 String address;
 
 Person(String name, String address) {
 this.name = name;
 this.address = address;
 }
 
 public String getAddress() {
 return address;
 }
 
 public void setAddress(String address) {
 this.address = address;
 }
 }
  • 56. public class Person {
 
 String name;
 
 String address;
 
 Person(String name, String address) {
 this.name = name;
 this.address = address;
 }
 
 public String getAddress() {
 return address;
 }
 
 public void setAddress(String address) {
 this.address = address;
 }
 
 @Override
 public boolean equals(Object o) {
 if (this == o) {
 return true;
 }
 if (o == null || getClass() != o.getClass()) {
 return false;
 }
 
 Person person = (Person) o;
 
 if (!name.equals(person.name)) {
 return false;
 }
 return address != null ? address.equals(person.address) : person.address == null;
 
 }
 
 @Override
 public int hashCode() {
 int result = name.hashCode();
 result = 31 * result + (address != null ? address.hashCode() : 0);
 return result;
 }
 
 @Override

  • 57. data class Person(val name: String, val address: String)
  • 59. // Define an extension function on Context fun Context.toast(message: String) {
 Toast.makeText(this.applicationContext, message, Toast.LENGTH_SHORT).show()
 } // available in class Context and its descendants toast("Hello, Kotlin!")
  • 60.
  • 61.
  • 62.
  • 63.