6. www.bapspatil.com
Enter,
Kotlin.
● Takes care of
null-safety.
● More concise &
much shorter code.
● Runs on JVM.
● Can be used along
with Java files.
...and more that can’t be covered in my talk.
8. www.bapspatil.com
Declaring A
Variable...
● var - Mutable variable
● val - Immutable or final variable
Example:
var name: String? = “TechieAid”
val students: Int = 120
? means the variable can be null.
11. www.bapspatil.com
Java
public class User {
private int id;
private String name;
public User() { }
public User(String name, int id) {
this.id = id;
this.name = name;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String toString() {
return “User: “ + “ID=” + this.id
+ “Name=” + this.name;
}
}
Kotlin
data class User (
val id: Int,
val name: String
)
And that’s another
reason Kotlin rules!
16. www.bapspatil.com
Great! Where Do I Learn Kotlin From?
Kotlinlang.org • Official Website & Documentation
Google Codelabs •
Kotlin Is Awesome! • kotlin.link
Mindorks.com •
Talking Kotlin •
Kotlin Bootcamp for Programmers •