SlideShare une entreprise Scribd logo
1  sur  84
Télécharger pour lire hors ligne
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
package com.cwdoh.devfest2017
class Gugu {
fun print() {
for (i in 1..9) {
for (j in 1..9) {
print("$i * $j = ${i * j}")
}
}
}
}
🤩😲😘😍
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
package com.cwdoh.devfest2017
class Session {
val speaker = "cwdoh"
val title: String
= "Kotlin: How it works"
var room: Int? = null
fun description()
= "$speaker's talk: '$title' at room $room"
}
Kotlin, 어떻게 동작하나요
package com.cwdoh.devfest2017
class Session {
val speaker = "cwdoh"
val title: String
= "Kotlin: How it works"
var room: Int? = null
fun description()
= "$speaker's talk: '$title' at room $room"
}
class Session {
var name = "cwdoh"
}
public final class Session {
@NotNull
private String name = "cwdoh";
@NotNull
public final String getName() {
return this.name;
}
public final void setName(@NotNull String var1) {
Intrinsics.checkParameterIsNotNull(var1, "<set-?>");
this.name = var1;
}
}
class Session {
val name = "cwdoh"
}
public final class Session {
@NotNull
private final String name = "cwdoh";
@NotNull
public final String getName() {
return this.name;
}
}
class Session {
val speaker = "cwdoh"
fun description() {
val talks = "$speaker's talks"
println(talks)
}
}
public final class Session {
@NotNull
private final String speaker = "cwdoh";
@NotNull
public final String getSpeaker() {
return this.speaker;
}
public final void description() {
String talks = "" + this.speaker + "'s talks";
System.out.println(talks);
}
}
Kotlin, 어떻게 동작하나요
package com.cwdoh.devfest2017
class Session {
val speaker = "cwdoh"
val title: String
= "Kotlin: How it works"
var room: Int? = null
fun description()
= "$speaker's talk: '$title' at room $room"
}
class Session {
var name: String = "cwdoh"
}
public final class Session {
@NotNull
private String name = "cwdoh";
@NotNull
public final String getName() {
return this.name;
}
public final void setName(@NotNull String var1) {
Intrinsics.checkParameterIsNotNull(var1, "<set-?>");
this.name = var1;
}
}
public static void checkParameterIsNotNull(Object value, String paramName)
{
if (value == null) {
throwParameterIsNullException(paramName);
}
}
class Session {
fun hello(name: String) = "hello, " + name
}
public final class Session {
@NotNull
public final String hello(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
return "hello, " + name;
}
}
public static void checkParameterIsNotNull(Object value, String paramName)
{
if (value == null) {
throwParameterIsNullException(paramName);
}
}
class Session {
fun hello(name: String) = "hello, " + name
fun print() {
val name: String = "cwdoh"
print(hello(name))
}
}
public final class Session {
@NotNull
public final String hello(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
return "hello, " + name;
}
public final void print() {
String name = "cwdoh";
String var2 = this.hello(name);
System.out.print(var2);
}
}
class Session {
fun hello(name: String) = "hello, " + name
fun print() {
val name: String? = null
print(hello(name!!))
}
}
public final class Session {
@NotNull
public final String hello(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
return "hello, " + name;
}
public final void print() {
String name = (String)null;
Intrinsics.throwNpe();
String var2 = this.hello(name);
System.out.print(var2);
}
}
NullPointerException? 😎
Kotlin, 어떻게 동작하나요
package com.cwdoh.devfest2017
class Session {
val speaker = "cwdoh"
val title: String
= "Kotlin: How it works"
var room: Int? = null
fun description()
= "$speaker's talk: '$title' at room $room"
}
class Session {
val speaker = "cwdoh"
val title: String = "Kotlin: How it works"
var room: Int? = null
fun description() = "$speaker's talk: '$title' at room $room"
}
public final class Session {
@NotNull
private final String speaker = "cwdoh";
@NotNull
private final String title = "Kotlin: How it works";
@Nullable
private Integer room;
…
@NotNull
public final String description() {
return "" + this.speaker + "'s talk: ‘"
+ this.title + "' at room " + this.room;
}
}
// access flags 0x11
public final description()Ljava/lang/String;
@Lorg/jetbrains/annotations/NotNull;() // invisible
L0
LINENUMBER 8 L0
NEW java/lang/StringBuilder
DUP
INVOKESPECIAL java/lang/StringBuilder.<init> ()V
LDC ""
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
ALOAD 0
GETFIELD com/cwdoh/devfest2017/Session.speaker : Ljava/lang/String;
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
LDC "'s talk: '"
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
ALOAD 0
GETFIELD com/cwdoh/devfest2017/Session.title : Ljava/lang/String;
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
LDC "' at room "
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
ALOAD 0
GETFIELD com/cwdoh/devfest2017/Session.room : Ljava/lang/Integer;
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
INVOKEVIRTUAL java/lang/StringBuilder.toString ()Ljava/lang/String;
ARETURN
Kotlin, 어떻게 동작하나요
class NotOpenedClass
open class OpenedClass
public final class NotOpenedClass {
}
public class OpenedClass {
}
interface Interface
open class OpenClass
class ChildClass: OpenClass(), Interface
fun test() { val child = ChildClass() }
public final class ChildClass
extends OpenClass implements Interface {}
public interface Interface {}
public class OpenClass {}
public final class SimpleClassKt {
public static final void test() {
new ChildClass();
}
}
Kotlin, 어떻게 동작하나요
class Person1 constructor(name: String)
class Person2(name: String)
public final class Person1 {
public Person1(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
super();
}
}
public final class Person2 {
public Person2(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
super();
}
}
class Person constructor(val name: String)
public final class Person {
@NotNull
private final String name;
@NotNull
public final String getName() {
return this.name;
}
public Person(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
super();
this.name = name;
}
}
class Person constructor(val name: String) {
val greetings: String
init { greetings = "hello, $name” }
}
public final class Person {
@NotNull private String greetings;
@NotNull private final String name;
@NotNull public final String getGreetings() { return this.greetings; }
@NotNull public final String getName() { return this.name; }
public Person(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
super();
this.name = name;
this.greetings = "hello, " + this.name;
}
}
class Person constructor(val name: String) {
val greetings: String
var age: Int = null
constructor(name: String, age: Int): this(name) { this.age = age }
init { greetings = "hello, $name” }
}
public final class Person {
@NotNull
private final String greetings;
private int age;
…
public Person(@NotNull String name) {
Intrinsics.checkParameterIsNotNull(name, "name");
super();
this.name = name;
this.age = ((Number)null).intValue();
this.greetings = "hello, " + this.name;
}
public Person(@NotNull String name, int age) {
Intrinsics.checkParameterIsNotNull(name, "name");
this(name);
this.age = age;
}
}
Kotlin, 어떻게 동작하나요
open class Parent {
private val a = println("Parent.a")
constructor(arg: Unit=println("Parent primary constructor arg")) {
println("Parent primary constructor")
}
init { println("Parent.init") }
private val b = println("Parent.b")
}
class Child : Parent {
val a = println("Child.a")
init { println("Child.init 1") }
constructor(arg: Unit=println("Child primary constructor arg")) : super() {
println("Child primary constructor")
}
val b = println("Child.b")
constructor(arg: Int, arg2:Unit= println("Child secondary constructor arg")): this() {
println("Child secondary constructor")
}
init { println("Child.init 2") }
}
fun main(args: Array<String>) {
Child(1)
}
Child secondary constructor arg
Child primary constructor arg
Parent primary constructor arg
Parent.a
Parent.init
Parent.b
Parent primary constructor
Child.a
Child.init 1
Child.b
Child.init 2
Child primary constructor
Child secondary constructor
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
class Props {
var size: Int = 0
val isEmpty: Boolean
get() = this.size == 0
}
public final class Props {
private int size;
public final int getSize() {
return this.size;
}
public final void setSize(int var1) {
this.size = var1;
}
public final boolean isEmpty() {
return this.size == 0;
}
}
class Props {
var age: Int = 0
set(value: Int) {
age = if (value < 0) 0 else value
}
}
public final class Props {
private int age;
public final int getAge() {
return this.age;
}
public final void setAge(int value) {
this.setAge(value < 0? 0:value);
}
}
class Props {
var age: Int = 0
private set
}
public final class Props {
private int age;
public final int getAge() {
return this.age;
}
private final void setAge(int var1) {
this.age = var1;
}
}
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
class MainActivity : AppCompatActivity() {
private var mWelcomeTextView: TextView? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
mWelcomeTextView
= findViewById(R.id.msgView) as TextView
}
}
class MainActivity : AppCompatActivity() {
private lateinit var mWelcomeTextView: TextView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
mWelcomeTextView
= findViewById(R.id.msgView) as TextView
}
}
class MainActivity : AppCompatActivity() {
private val mWelcomeTextView: TextView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// ?????
// mWelcomeTextView =
// findViewById(R.id.msgView) as TextView
}
}
class MainActivity : AppCompatActivity() {
private val messageView : TextView by lazy {
// messageView
findViewById(R.id.message_view) as TextView
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
fun onSayHello() {
messageView.text = "Hello"
}
}
Kotlin, 어떻게 동작하나요
class Delegate {
operator fun getValue(
thisRef: Any?,
property: KProperty<*>
): String {
// do something
// return value
}
operator fun setValue(
thisRef: Any?,
property: KProperty<*>, value: String
) {
// do something
// assign
}
}
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
class Demo {
val myName : String by lazy { "John" }
}
public final class Demo {
// $FF: synthetic field
static final KProperty[] $$delegatedProperties = new KProperty[]{ … };
@NotNull
private final Lazy myName$delegate;
@NotNull
public final String getMyName() {
Lazy var1 = this.myName$delegate;
KProperty var3 = $$delegatedProperties[0];
return (String)var1.getValue();
}
public Demo() {
this.myName$delegate = LazyKt.lazy((Function0)null.INSTANCE);
}
}
class Demo {
val myName : String by lazy { getNameFromPreference() }
} initializerdelegate
myName
Lazy<T>
getValue()
{ getNameFromPreference() }initializer
class Demo {
val myName : String by lazy { getNameFromPreference() }
}
myName
Lazy<T>
getValue() UNINITIALIZED_VALUE
{ getNameFromPreference() }initializer
class Demo {
val myName : String by lazy { getNameFromPreference() }
}
myName
Lazy<T>
getValue() “John”
{ getNameFromPreference() }initializer
class Demo {
val myName : String by lazy { getNameFromPreference() }
}
myName
Lazy<T>
getValue() “John”
initializer null
class Demo {
val myName : String by lazy { getNameFromPreference() }
}
class MainActivity : AppCompatActivity() {
private val messageView : TextView by lazy {
// messageView
findViewById(R.id.message_view) as TextView
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
fun onSayHello() {
messageView.text = "Hello"
}
}
val messageView: TextView by lazy { findViewById(R.id.message_view) as TextView }
property delegate
Kotlin, 어떻게 동작하나요
interface Base {
fun printX()
}
class BaseImpl(val x: Int) : Base {
override fun printX() { print(x) }
}
interface A {
fun hello(): String
}
class B : A {
override fun hello() = "Hello!!"
}
class C : A by B()
public interface A {
@NotNull
String hello();
}
public final class B implements A {
@NotNull
public String hello() {
return "Hello!!";
}
}
public final class C implements A {
// $FF: synthetic field
private final B $$delegate_0 = new B();
@NotNull
public String hello() {
return this.$$delegate_0.hello();
}
}
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
fun String.hello() : String {
return "Hello, $this"
}
fun main(args: Array<String>) {
val whom = "cwdoh"
println(whom.hello())
}
// Result
Hello, cwdoh
Kotlin, 어떻게 동작하나요
open class C
class D: C()
fun C.foo() = "c"
fun D.foo() = "d"
fun printFoo(c: C) {
println(c.foo())
}
class Demo {
fun run() {
printFoo(D())
}
}
public class C {}
public final class D extends C {}
public final class SimpleClassKt {
@NotNull
public static final String foo(@NotNull C $receiver) {
Intrinsics.checkParameterIsNotNull($receiver, "$receiver");
return "c";
}
@NotNull
public static final String foo(@NotNull D $receiver) {
Intrinsics.checkParameterIsNotNull($receiver, "$receiver");
return "d";
}
public static final void printFoo(@NotNull C c) {
Intrinsics.checkParameterIsNotNull(c, "c");
String var1 = foo(c);
System.out.println(var1);
}
}
public final class Demo {
public final void run() {
SimpleClassKt.printFoo((C)(new D()));
}
}
class Person {
fun hello() {
println("hello!")
}
}
fun Person.hello() {
println(" ?!!")
}
fun main(args: Array<String>)
{
Person().hello()
}
// Result
hello!
public final class Person {
public final void hello() {
String var1 = "hello!";
System.out.println(var1);
}
}
public final class SimpleClassKt {
public static final void hello(@NotNull Person $receiver) {
Intrinsics.checkParameterIsNotNull(
$receiver, "$receiver");
String var1 = " ?!!";
System.out.println(var1);
}
public static final void main(@NotNull String[] args) {
Intrinsics.checkParameterIsNotNull(args, "args");
(new Person()).hello();
}
}
class D {
fun bar() {
println("D.bar()")
}
}
class C {
fun baz() {
println("C.bar()")
}
fun D.foo() {
bar() // calls D.bar
baz() // calls C.baz
}
fun caller(d: D) {
d.foo()
}
}
public final class C {
public final void baz() {
String var1 = "C.bar()";
System.out.println(var1);
}
public final void foo(@NotNull D $receiver) {
Intrinsics.checkParameterIsNotNull($receiver, "$receiver");
$receiver.bar();
this.baz();
}
public final void caller(@NotNull D d) {
Intrinsics.checkParameterIsNotNull(d, "d");
this.foo(d);
}
}
public final class D {
public final void bar() {
String var1 = "D.bar()";
System.out.println(var1);
}
}
Kotlin, 어떻게 동작하나요
data class Length(var centimeters: Int = 0)
var Length.meters: Float
get() {
return centimeters / 100.0f
}
set(meters: Float) {
this.centimeters = (meters * 100.0f).toInt()
}
data class Length(var centimeters: Int = 0)
var Length.meters: Float
get() {
return centimeters / 100.0f
}
set(meters: Float) {
this.centimeters = (meters * 100.0f).toInt()
}
public final class Length {
private int centimeters;
...
}
public final class ExtensionsKt {
public static final float getMeters(
@NotNull Length $receiver) {
Intrinsics.checkParameterIsNotNull($receiver, "$receiver");
return (float)$receiver.getCentimeters() / 100.0F;
}
public static final void setMeters(
@NotNull Length $receiver, float meters) {
Intrinsics.checkParameterIsNotNull($receiver, "$receiver");
$receiver.setCentimeters((int)(meters * 100.0F));
}
...
}
fun Any?.toString(): String
{
if (this == null)
return “null"
return toString()
}
public final class SimpleClassKt {
@NotNull
public static final String
toString(@Nullable Object $receiver) {
return $receiver == null?
"null":$receiver.toString();
}
}
fun Any?.toString(): String {
println("Extension is called.")
if (this == null) return "null"
return toString()
}
fun main(args: Array<String>) {
val var1 : Any? = null
println(var1.toString())
val str1 : String? = null
println(str1.toString())
var str2 : String? = "hello"
println(str2.toString())
var str3 : String = "world"
println(str3.toString())
}
public final class SimpleClassKt {
@NotNull
public static final String toString(@Nullable Object $receiver) {
String var1 = "Extension is called.";
System.out.println(var1);
return $receiver == null?"null":$receiver.toString();
}
public static final void main(@NotNull String[] args) {
Intrinsics.checkParameterIsNotNull(args, “args");
Object var1 = null;
String str1 = toString(var1);
System.out.println(str1);
str1 = (String)null;
String str2 = toString(str1);
System.out.println(str2);
str2 = "hello";
String str3 = toString(str2);
System.out.println(str3);
str3 = "world";
String var5 = str3.toString();
System.out.println(var5);
}
}
Extension is called.
null
Extension is called.
null
Extension is called.
hello
world
Kotlin, 어떻게 동작하나요
fun sing() {
println(" ")
println(" ")
println(" ")
}
fun beatbox() {
println(" ")
}
fun ensemble() {
sing()
beatbox()
sing()
beatbox()
}
public final class SimpleClassKt {
public static final void sing() {
String var0 = " ";
System.out.println(var0);
var0 = " ";
System.out.println(var0);
var0 = " ";
System.out.println(var0);
}
public static final void beatbox() {
String var0 = " ";
System.out.println(var0);
}
public static final void ensemble() {
sing();
beatbox();
sing();
beatbox();
}
}
inline fun sing() {
println(" ")
println(" ")
println(" ")
}
fun beatbox() {
println(" ")
}
fun ensemble() {
sing()
beatbox()
sing()
beatbox()
}
public final class SimpleClassKt {
public static final void sing() {
String var1 = " ";
…
}
public static final void beatbox() {
…
}
public static final void ensemble() {
String var0 = " ";
System.out.println(var0);
var0 = " ";
System.out.println(var0);
var0 = " ";
System.out.println(var0);
beatbox();
var0 = " ";
System.out.println(var0);
var0 = " ";
System.out.println(var0);
var0 = " ";
System.out.println(var0);
beatbox();
}
}
fun log(message: () -> String) {
println(message())
}
fun test() {
log { "Lorem ipsum dolor sit amet, consectetur ..." }
}
public final class SimpleClassKt {
public static final void log(@NotNull Function0 message) {
Intrinsics.checkParameterIsNotNull(message, "message");
Object var1 = message.invoke();
System.out.println(var1);
}
public static final void test() {
log((Function0)null.INSTANCE);
}
}
inline fun trace(message: String) {}
fun doSomething() {
print("I'm doing something!")
trace("doSomething() is doing something!")
}
public final class SimpleClassKt {
public static final void trace(@NotNull String message) {
Intrinsics.checkParameterIsNotNull(message, "message");
}
public static final void doSomething() {
String var0 = "I'm doing something!";
System.out.print(var0);
var0 = "doSomething() is doing something!";
}
}
inline fun log(message: () -> String) {
println(message())
}
fun test() {
log { "Lorem ipsum dolor sit amet, consectetur ..." }
}
public final class SimpleClassKt {
public static final void log(@NotNull Function0 message) {
Intrinsics.checkParameterIsNotNull(message, "message");
Object var2 = message.invoke();
System.out.println(var2);
}
public static final void test() {
String var0 = "Lorem ipsum dolor sit amet, consectetur ...";
System.out.println(var0);
}
}
inline fun trace(message: ()-> String) {}
fun doSomething() {
trace {
val receiver = "nurimaru"
val sender = "cwdoh"
"$sender wanna give $receiver big thank you for good tips."
}
}
public final class SimpleClassKt {
public static final boolean isDebug() {
return true;
}
public static final void trace(@NotNull Function0 message) {
Intrinsics.checkParameterIsNotNull(message, "message");
}
public static final void doSomething() {
}
}
https://goo.gl/8VdiCz https://goo.gl/H9iih9
Kotlin, 어떻게 동작하나요

Contenu connexe

Tendances

Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsBartosz Kosarzycki
 
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Codemotion
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Mario Fusco
 
Introduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoIntroduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoMuhammad Abdullah
 
AST Transformations
AST TransformationsAST Transformations
AST TransformationsHamletDRC
 
Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersBartosz Kosarzycki
 
Idiomatic Kotlin
Idiomatic KotlinIdiomatic Kotlin
Idiomatic Kotlinintelliyole
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performanceintelliyole
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)HamletDRC
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongMario Fusco
 
The TclQuadcode Compiler
The TclQuadcode CompilerThe TclQuadcode Compiler
The TclQuadcode CompilerDonal Fellows
 
Java programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarJava programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarROHIT JAISWAR
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!José Paumard
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns ReconsideredAlex Miller
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)Pavlo Baron
 
Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)intelliyole
 

Tendances (20)

Kotlin, why?
Kotlin, why?Kotlin, why?
Kotlin, why?
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
 
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
 
Introduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoIntroduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demo
 
AST Transformations
AST TransformationsAST Transformations
AST Transformations
 
Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
 
Idiomatic Kotlin
Idiomatic KotlinIdiomatic Kotlin
Idiomatic Kotlin
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
 
Comparing JVM languages
Comparing JVM languagesComparing JVM languages
Comparing JVM languages
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
The TclQuadcode Compiler
The TclQuadcode CompilerThe TclQuadcode Compiler
The TclQuadcode Compiler
 
Java programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswarJava programming lab_manual_by_rohit_jaiswar
Java programming lab_manual_by_rohit_jaiswar
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns Reconsidered
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
 
Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)
 

Similaire à Kotlin, 어떻게 동작하나요

Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldBTI360
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodecamp Romania
 
GeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with GroovyGeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with GroovyIván López Martín
 
Kotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan SoaresKotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan SoaresiMasters
 
つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~kamedon39
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo....NET Conf UY
 
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018 Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018 Codemotion
 
かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版Yutaka Kato
 
Nice to meet Kotlin
Nice to meet KotlinNice to meet Kotlin
Nice to meet KotlinJieyi Wu
 
Groovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークGroovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークTsuyoshi Yamamoto
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEDarwin Durand
 
Kotlin Overview (PT-BR)
Kotlin Overview (PT-BR)Kotlin Overview (PT-BR)
Kotlin Overview (PT-BR)ThomasHorta
 
The Future of JVM Languages
The Future of JVM Languages The Future of JVM Languages
The Future of JVM Languages VictorSzoltysek
 

Similaire à Kotlin, 어떻게 동작하나요 (20)

Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 World
 
Presentatie - Introductie in Groovy
Presentatie - Introductie in GroovyPresentatie - Introductie in Groovy
Presentatie - Introductie in Groovy
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical Groovy
 
Scala in practice
Scala in practiceScala in practice
Scala in practice
 
GeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with GroovyGeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with Groovy
 
OOP Lab Report.docx
OOP Lab Report.docxOOP Lab Report.docx
OOP Lab Report.docx
 
Kotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan SoaresKotlin : Advanced Tricks - Ubiratan Soares
Kotlin : Advanced Tricks - Ubiratan Soares
 
Introduzione a C#
Introduzione a C#Introduzione a C#
Introduzione a C#
 
C# Is The Future
C# Is The FutureC# Is The Future
C# Is The Future
 
Java Class Design
Java Class DesignJava Class Design
Java Class Design
 
つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018 Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018
 
Pure kotlin
Pure kotlinPure kotlin
Pure kotlin
 
かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版かとうの Kotlin 講座 こってり版
かとうの Kotlin 講座 こってり版
 
Nice to meet Kotlin
Nice to meet KotlinNice to meet Kotlin
Nice to meet Kotlin
 
Groovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークGroovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトーク
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
 
Kotlin Overview (PT-BR)
Kotlin Overview (PT-BR)Kotlin Overview (PT-BR)
Kotlin Overview (PT-BR)
 
The Future of JVM Languages
The Future of JVM Languages The Future of JVM Languages
The Future of JVM Languages
 

Plus de Chang W. Doh

Exploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively appExploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively appChang W. Doh
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Chang W. Doh
 
introduction to Web Assembly
introduction to Web Assembly introduction to Web Assembly
introduction to Web Assembly Chang W. Doh
 
PWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - KeynotePWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - KeynoteChang W. Doh
 
PWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSPWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSChang W. Doh
 
CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나Chang W. Doh
 
Natively Web App & Service Worker
Natively Web App & Service WorkerNatively Web App & Service Worker
Natively Web App & Service WorkerChang W. Doh
 
초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101Chang W. Doh
 
Service Worker 201 (한국어)
Service Worker 201 (한국어)Service Worker 201 (한국어)
Service Worker 201 (한국어)Chang W. Doh
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)Chang W. Doh
 
Service Worker 101 (en)
Service Worker 101 (en)Service Worker 101 (en)
Service Worker 101 (en)Chang W. Doh
 
Service Worker 101 (한국어)
Service Worker 101 (한국어)Service Worker 101 (한국어)
Service Worker 101 (한국어)Chang W. Doh
 
What is next for the web
What is next for the webWhat is next for the web
What is next for the webChang W. Doh
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service WorkerChang W. Doh
 
Chrome enchanted 2015
Chrome enchanted 2015Chrome enchanted 2015
Chrome enchanted 2015Chang W. Doh
 
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기Chang W. Doh
 
Polymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymerPolymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymerChang W. Doh
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web AnimationsChang W. Doh
 
SOSCON 2014: 문서 기반의 오픈소스 기여하기
SOSCON 2014: 문서 기반의 오픈소스 기여하기SOSCON 2014: 문서 기반의 오픈소스 기여하기
SOSCON 2014: 문서 기반의 오픈소스 기여하기Chang W. Doh
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChang W. Doh
 

Plus de Chang W. Doh (20)

Exploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively appExploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively app
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가
 
introduction to Web Assembly
introduction to Web Assembly introduction to Web Assembly
introduction to Web Assembly
 
PWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - KeynotePWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - Keynote
 
PWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSPWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPS
 
CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나
 
Natively Web App & Service Worker
Natively Web App & Service WorkerNatively Web App & Service Worker
Natively Web App & Service Worker
 
초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101
 
Service Worker 201 (한국어)
Service Worker 201 (한국어)Service Worker 201 (한국어)
Service Worker 201 (한국어)
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)
 
Service Worker 101 (en)
Service Worker 101 (en)Service Worker 101 (en)
Service Worker 101 (en)
 
Service Worker 101 (한국어)
Service Worker 101 (한국어)Service Worker 101 (한국어)
Service Worker 101 (한국어)
 
What is next for the web
What is next for the webWhat is next for the web
What is next for the web
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
 
Chrome enchanted 2015
Chrome enchanted 2015Chrome enchanted 2015
Chrome enchanted 2015
 
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
 
Polymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymerPolymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymer
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations
 
SOSCON 2014: 문서 기반의 오픈소스 기여하기
SOSCON 2014: 문서 기반의 오픈소스 기여하기SOSCON 2014: 문서 기반의 오픈소스 기여하기
SOSCON 2014: 문서 기반의 오픈소스 기여하기
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 

Dernier

Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxLMW Machine Tool Division
 
Landsman converter for power factor improvement
Landsman converter for power factor improvementLandsman converter for power factor improvement
Landsman converter for power factor improvementVijayMuni2
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingMarian Marinov
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide LaboratoryBahzad5
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...soginsider
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxrealme6igamerr
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid BodyAhmadHajasad2
 
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfSummer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfNaveenVerma126
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Bahzad5
 
Mohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptxMohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptxKISHAN KUMAR
 
Clutches and brkesSelect any 3 position random motion out of real world and d...
Clutches and brkesSelect any 3 position random motion out of real world and d...Clutches and brkesSelect any 3 position random motion out of real world and d...
Clutches and brkesSelect any 3 position random motion out of real world and d...sahb78428
 
The relationship between iot and communication technology
The relationship between iot and communication technologyThe relationship between iot and communication technology
The relationship between iot and communication technologyabdulkadirmukarram03
 
ASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entenderASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entenderjuancarlos286641
 
Gender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 ProjectGender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 Projectreemakb03
 
Design of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxDesign of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxYogeshKumarKJMIT
 
Test of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxTest of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxHome
 

Dernier (20)

Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
 
Landsman converter for power factor improvement
Landsman converter for power factor improvementLandsman converter for power factor improvement
Landsman converter for power factor improvement
 
Lecture 4 .pdf
Lecture 4                              .pdfLecture 4                              .pdf
Lecture 4 .pdf
 
Litature Review: Research Paper work for Engineering
Litature Review: Research Paper work for EngineeringLitature Review: Research Paper work for Engineering
Litature Review: Research Paper work for Engineering
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Présentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdfPrésentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdf
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
 
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfSummer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)
 
Mohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptxMohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptx
 
Clutches and brkesSelect any 3 position random motion out of real world and d...
Clutches and brkesSelect any 3 position random motion out of real world and d...Clutches and brkesSelect any 3 position random motion out of real world and d...
Clutches and brkesSelect any 3 position random motion out of real world and d...
 
The relationship between iot and communication technology
The relationship between iot and communication technologyThe relationship between iot and communication technology
The relationship between iot and communication technology
 
ASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entenderASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entender
 
Gender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 ProjectGender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 Project
 
Design of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxDesign of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptx
 
Test of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxTest of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptx
 
Présentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdfPrésentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdf
 

Kotlin, 어떻게 동작하나요

  • 6. package com.cwdoh.devfest2017 class Gugu { fun print() { for (i in 1..9) { for (j in 1..9) { print("$i * $j = ${i * j}") } } } }
  • 11. package com.cwdoh.devfest2017 class Session { val speaker = "cwdoh" val title: String = "Kotlin: How it works" var room: Int? = null fun description() = "$speaker's talk: '$title' at room $room" }
  • 13. package com.cwdoh.devfest2017 class Session { val speaker = "cwdoh" val title: String = "Kotlin: How it works" var room: Int? = null fun description() = "$speaker's talk: '$title' at room $room" }
  • 14. class Session { var name = "cwdoh" } public final class Session { @NotNull private String name = "cwdoh"; @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) { Intrinsics.checkParameterIsNotNull(var1, "<set-?>"); this.name = var1; } }
  • 15. class Session { val name = "cwdoh" } public final class Session { @NotNull private final String name = "cwdoh"; @NotNull public final String getName() { return this.name; } }
  • 16. class Session { val speaker = "cwdoh" fun description() { val talks = "$speaker's talks" println(talks) } } public final class Session { @NotNull private final String speaker = "cwdoh"; @NotNull public final String getSpeaker() { return this.speaker; } public final void description() { String talks = "" + this.speaker + "'s talks"; System.out.println(talks); } }
  • 18. package com.cwdoh.devfest2017 class Session { val speaker = "cwdoh" val title: String = "Kotlin: How it works" var room: Int? = null fun description() = "$speaker's talk: '$title' at room $room" }
  • 19. class Session { var name: String = "cwdoh" } public final class Session { @NotNull private String name = "cwdoh"; @NotNull public final String getName() { return this.name; } public final void setName(@NotNull String var1) { Intrinsics.checkParameterIsNotNull(var1, "<set-?>"); this.name = var1; } } public static void checkParameterIsNotNull(Object value, String paramName) { if (value == null) { throwParameterIsNullException(paramName); } }
  • 20. class Session { fun hello(name: String) = "hello, " + name } public final class Session { @NotNull public final String hello(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); return "hello, " + name; } } public static void checkParameterIsNotNull(Object value, String paramName) { if (value == null) { throwParameterIsNullException(paramName); } }
  • 21. class Session { fun hello(name: String) = "hello, " + name fun print() { val name: String = "cwdoh" print(hello(name)) } } public final class Session { @NotNull public final String hello(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); return "hello, " + name; } public final void print() { String name = "cwdoh"; String var2 = this.hello(name); System.out.print(var2); } }
  • 22. class Session { fun hello(name: String) = "hello, " + name fun print() { val name: String? = null print(hello(name!!)) } } public final class Session { @NotNull public final String hello(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); return "hello, " + name; } public final void print() { String name = (String)null; Intrinsics.throwNpe(); String var2 = this.hello(name); System.out.print(var2); } } NullPointerException? 😎
  • 24. package com.cwdoh.devfest2017 class Session { val speaker = "cwdoh" val title: String = "Kotlin: How it works" var room: Int? = null fun description() = "$speaker's talk: '$title' at room $room" }
  • 25. class Session { val speaker = "cwdoh" val title: String = "Kotlin: How it works" var room: Int? = null fun description() = "$speaker's talk: '$title' at room $room" } public final class Session { @NotNull private final String speaker = "cwdoh"; @NotNull private final String title = "Kotlin: How it works"; @Nullable private Integer room; … @NotNull public final String description() { return "" + this.speaker + "'s talk: ‘" + this.title + "' at room " + this.room; } }
  • 26. // access flags 0x11 public final description()Ljava/lang/String; @Lorg/jetbrains/annotations/NotNull;() // invisible L0 LINENUMBER 8 L0 NEW java/lang/StringBuilder DUP INVOKESPECIAL java/lang/StringBuilder.<init> ()V LDC "" INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder; ALOAD 0 GETFIELD com/cwdoh/devfest2017/Session.speaker : Ljava/lang/String; INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder; LDC "'s talk: '" INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder; ALOAD 0 GETFIELD com/cwdoh/devfest2017/Session.title : Ljava/lang/String; INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder; LDC "' at room " INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder; ALOAD 0 GETFIELD com/cwdoh/devfest2017/Session.room : Ljava/lang/Integer; INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/Object;)Ljava/lang/StringBuilder; INVOKEVIRTUAL java/lang/StringBuilder.toString ()Ljava/lang/String; ARETURN
  • 28. class NotOpenedClass open class OpenedClass public final class NotOpenedClass { } public class OpenedClass { }
  • 29. interface Interface open class OpenClass class ChildClass: OpenClass(), Interface fun test() { val child = ChildClass() } public final class ChildClass extends OpenClass implements Interface {} public interface Interface {} public class OpenClass {} public final class SimpleClassKt { public static final void test() { new ChildClass(); } }
  • 31. class Person1 constructor(name: String) class Person2(name: String) public final class Person1 { public Person1(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); super(); } } public final class Person2 { public Person2(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); super(); } }
  • 32. class Person constructor(val name: String) public final class Person { @NotNull private final String name; @NotNull public final String getName() { return this.name; } public Person(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); super(); this.name = name; } }
  • 33. class Person constructor(val name: String) { val greetings: String init { greetings = "hello, $name” } } public final class Person { @NotNull private String greetings; @NotNull private final String name; @NotNull public final String getGreetings() { return this.greetings; } @NotNull public final String getName() { return this.name; } public Person(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); super(); this.name = name; this.greetings = "hello, " + this.name; } }
  • 34. class Person constructor(val name: String) { val greetings: String var age: Int = null constructor(name: String, age: Int): this(name) { this.age = age } init { greetings = "hello, $name” } } public final class Person { @NotNull private final String greetings; private int age; … public Person(@NotNull String name) { Intrinsics.checkParameterIsNotNull(name, "name"); super(); this.name = name; this.age = ((Number)null).intValue(); this.greetings = "hello, " + this.name; } public Person(@NotNull String name, int age) { Intrinsics.checkParameterIsNotNull(name, "name"); this(name); this.age = age; } }
  • 36. open class Parent { private val a = println("Parent.a") constructor(arg: Unit=println("Parent primary constructor arg")) { println("Parent primary constructor") } init { println("Parent.init") } private val b = println("Parent.b") } class Child : Parent { val a = println("Child.a") init { println("Child.init 1") } constructor(arg: Unit=println("Child primary constructor arg")) : super() { println("Child primary constructor") } val b = println("Child.b") constructor(arg: Int, arg2:Unit= println("Child secondary constructor arg")): this() { println("Child secondary constructor") } init { println("Child.init 2") } } fun main(args: Array<String>) { Child(1) } Child secondary constructor arg Child primary constructor arg Parent primary constructor arg Parent.a Parent.init Parent.b Parent primary constructor Child.a Child.init 1 Child.b Child.init 2 Child primary constructor Child secondary constructor
  • 39. class Props { var size: Int = 0 val isEmpty: Boolean get() = this.size == 0 } public final class Props { private int size; public final int getSize() { return this.size; } public final void setSize(int var1) { this.size = var1; } public final boolean isEmpty() { return this.size == 0; } }
  • 40. class Props { var age: Int = 0 set(value: Int) { age = if (value < 0) 0 else value } } public final class Props { private int age; public final int getAge() { return this.age; } public final void setAge(int value) { this.setAge(value < 0? 0:value); } }
  • 41. class Props { var age: Int = 0 private set } public final class Props { private int age; public final int getAge() { return this.age; } private final void setAge(int var1) { this.age = var1; } }
  • 44. class MainActivity : AppCompatActivity() { private var mWelcomeTextView: TextView? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) mWelcomeTextView = findViewById(R.id.msgView) as TextView } }
  • 45. class MainActivity : AppCompatActivity() { private lateinit var mWelcomeTextView: TextView override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) mWelcomeTextView = findViewById(R.id.msgView) as TextView } }
  • 46. class MainActivity : AppCompatActivity() { private val mWelcomeTextView: TextView override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) // ????? // mWelcomeTextView = // findViewById(R.id.msgView) as TextView } }
  • 47. class MainActivity : AppCompatActivity() { private val messageView : TextView by lazy { // messageView findViewById(R.id.message_view) as TextView } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } fun onSayHello() { messageView.text = "Hello" } }
  • 49. class Delegate { operator fun getValue( thisRef: Any?, property: KProperty<*> ): String { // do something // return value } operator fun setValue( thisRef: Any?, property: KProperty<*>, value: String ) { // do something // assign } }
  • 52. class Demo { val myName : String by lazy { "John" } } public final class Demo { // $FF: synthetic field static final KProperty[] $$delegatedProperties = new KProperty[]{ … }; @NotNull private final Lazy myName$delegate; @NotNull public final String getMyName() { Lazy var1 = this.myName$delegate; KProperty var3 = $$delegatedProperties[0]; return (String)var1.getValue(); } public Demo() { this.myName$delegate = LazyKt.lazy((Function0)null.INSTANCE); } }
  • 53. class Demo { val myName : String by lazy { getNameFromPreference() } } initializerdelegate
  • 54. myName Lazy<T> getValue() { getNameFromPreference() }initializer class Demo { val myName : String by lazy { getNameFromPreference() } }
  • 55. myName Lazy<T> getValue() UNINITIALIZED_VALUE { getNameFromPreference() }initializer class Demo { val myName : String by lazy { getNameFromPreference() } }
  • 56. myName Lazy<T> getValue() “John” { getNameFromPreference() }initializer class Demo { val myName : String by lazy { getNameFromPreference() } }
  • 57. myName Lazy<T> getValue() “John” initializer null class Demo { val myName : String by lazy { getNameFromPreference() } }
  • 58. class MainActivity : AppCompatActivity() { private val messageView : TextView by lazy { // messageView findViewById(R.id.message_view) as TextView } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } fun onSayHello() { messageView.text = "Hello" } }
  • 59. val messageView: TextView by lazy { findViewById(R.id.message_view) as TextView } property delegate
  • 61. interface Base { fun printX() } class BaseImpl(val x: Int) : Base { override fun printX() { print(x) } }
  • 62. interface A { fun hello(): String } class B : A { override fun hello() = "Hello!!" } class C : A by B()
  • 63. public interface A { @NotNull String hello(); } public final class B implements A { @NotNull public String hello() { return "Hello!!"; } } public final class C implements A { // $FF: synthetic field private final B $$delegate_0 = new B(); @NotNull public String hello() { return this.$$delegate_0.hello(); } }
  • 66. fun String.hello() : String { return "Hello, $this" } fun main(args: Array<String>) { val whom = "cwdoh" println(whom.hello()) } // Result Hello, cwdoh
  • 68. open class C class D: C() fun C.foo() = "c" fun D.foo() = "d" fun printFoo(c: C) { println(c.foo()) } class Demo { fun run() { printFoo(D()) } } public class C {} public final class D extends C {} public final class SimpleClassKt { @NotNull public static final String foo(@NotNull C $receiver) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); return "c"; } @NotNull public static final String foo(@NotNull D $receiver) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); return "d"; } public static final void printFoo(@NotNull C c) { Intrinsics.checkParameterIsNotNull(c, "c"); String var1 = foo(c); System.out.println(var1); } } public final class Demo { public final void run() { SimpleClassKt.printFoo((C)(new D())); } }
  • 69. class Person { fun hello() { println("hello!") } } fun Person.hello() { println(" ?!!") } fun main(args: Array<String>) { Person().hello() } // Result hello! public final class Person { public final void hello() { String var1 = "hello!"; System.out.println(var1); } } public final class SimpleClassKt { public static final void hello(@NotNull Person $receiver) { Intrinsics.checkParameterIsNotNull( $receiver, "$receiver"); String var1 = " ?!!"; System.out.println(var1); } public static final void main(@NotNull String[] args) { Intrinsics.checkParameterIsNotNull(args, "args"); (new Person()).hello(); } }
  • 70. class D { fun bar() { println("D.bar()") } } class C { fun baz() { println("C.bar()") } fun D.foo() { bar() // calls D.bar baz() // calls C.baz } fun caller(d: D) { d.foo() } } public final class C { public final void baz() { String var1 = "C.bar()"; System.out.println(var1); } public final void foo(@NotNull D $receiver) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); $receiver.bar(); this.baz(); } public final void caller(@NotNull D d) { Intrinsics.checkParameterIsNotNull(d, "d"); this.foo(d); } } public final class D { public final void bar() { String var1 = "D.bar()"; System.out.println(var1); } }
  • 72. data class Length(var centimeters: Int = 0) var Length.meters: Float get() { return centimeters / 100.0f } set(meters: Float) { this.centimeters = (meters * 100.0f).toInt() }
  • 73. data class Length(var centimeters: Int = 0) var Length.meters: Float get() { return centimeters / 100.0f } set(meters: Float) { this.centimeters = (meters * 100.0f).toInt() } public final class Length { private int centimeters; ... } public final class ExtensionsKt { public static final float getMeters( @NotNull Length $receiver) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); return (float)$receiver.getCentimeters() / 100.0F; } public static final void setMeters( @NotNull Length $receiver, float meters) { Intrinsics.checkParameterIsNotNull($receiver, "$receiver"); $receiver.setCentimeters((int)(meters * 100.0F)); } ... }
  • 74. fun Any?.toString(): String { if (this == null) return “null" return toString() } public final class SimpleClassKt { @NotNull public static final String toString(@Nullable Object $receiver) { return $receiver == null? "null":$receiver.toString(); } }
  • 75. fun Any?.toString(): String { println("Extension is called.") if (this == null) return "null" return toString() } fun main(args: Array<String>) { val var1 : Any? = null println(var1.toString()) val str1 : String? = null println(str1.toString()) var str2 : String? = "hello" println(str2.toString()) var str3 : String = "world" println(str3.toString()) } public final class SimpleClassKt { @NotNull public static final String toString(@Nullable Object $receiver) { String var1 = "Extension is called."; System.out.println(var1); return $receiver == null?"null":$receiver.toString(); } public static final void main(@NotNull String[] args) { Intrinsics.checkParameterIsNotNull(args, “args"); Object var1 = null; String str1 = toString(var1); System.out.println(str1); str1 = (String)null; String str2 = toString(str1); System.out.println(str2); str2 = "hello"; String str3 = toString(str2); System.out.println(str3); str3 = "world"; String var5 = str3.toString(); System.out.println(var5); } } Extension is called. null Extension is called. null Extension is called. hello world
  • 77. fun sing() { println(" ") println(" ") println(" ") } fun beatbox() { println(" ") } fun ensemble() { sing() beatbox() sing() beatbox() } public final class SimpleClassKt { public static final void sing() { String var0 = " "; System.out.println(var0); var0 = " "; System.out.println(var0); var0 = " "; System.out.println(var0); } public static final void beatbox() { String var0 = " "; System.out.println(var0); } public static final void ensemble() { sing(); beatbox(); sing(); beatbox(); } }
  • 78. inline fun sing() { println(" ") println(" ") println(" ") } fun beatbox() { println(" ") } fun ensemble() { sing() beatbox() sing() beatbox() } public final class SimpleClassKt { public static final void sing() { String var1 = " "; … } public static final void beatbox() { … } public static final void ensemble() { String var0 = " "; System.out.println(var0); var0 = " "; System.out.println(var0); var0 = " "; System.out.println(var0); beatbox(); var0 = " "; System.out.println(var0); var0 = " "; System.out.println(var0); var0 = " "; System.out.println(var0); beatbox(); } }
  • 79. fun log(message: () -> String) { println(message()) } fun test() { log { "Lorem ipsum dolor sit amet, consectetur ..." } } public final class SimpleClassKt { public static final void log(@NotNull Function0 message) { Intrinsics.checkParameterIsNotNull(message, "message"); Object var1 = message.invoke(); System.out.println(var1); } public static final void test() { log((Function0)null.INSTANCE); } }
  • 80. inline fun trace(message: String) {} fun doSomething() { print("I'm doing something!") trace("doSomething() is doing something!") } public final class SimpleClassKt { public static final void trace(@NotNull String message) { Intrinsics.checkParameterIsNotNull(message, "message"); } public static final void doSomething() { String var0 = "I'm doing something!"; System.out.print(var0); var0 = "doSomething() is doing something!"; } }
  • 81. inline fun log(message: () -> String) { println(message()) } fun test() { log { "Lorem ipsum dolor sit amet, consectetur ..." } } public final class SimpleClassKt { public static final void log(@NotNull Function0 message) { Intrinsics.checkParameterIsNotNull(message, "message"); Object var2 = message.invoke(); System.out.println(var2); } public static final void test() { String var0 = "Lorem ipsum dolor sit amet, consectetur ..."; System.out.println(var0); } }
  • 82. inline fun trace(message: ()-> String) {} fun doSomething() { trace { val receiver = "nurimaru" val sender = "cwdoh" "$sender wanna give $receiver big thank you for good tips." } } public final class SimpleClassKt { public static final boolean isDebug() { return true; } public static final void trace(@NotNull Function0 message) { Intrinsics.checkParameterIsNotNull(message, "message"); } public static final void doSomething() { } }