{ // Return something } set(value) { // Set the value } val age: Int constructor(name: String, age: Int) { this.name = name this.age = age }G }G val person = Person("Salvador", 26) person.name = "Sanchez"
a 1,000 applications monitored by OverOps’s error analysis micro-agent 70% of the production environments that we looked at, NPEs were the most occurred exceptions.
billion-dollar mistake. It was the invention of the null reference in 1965. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.”
age = 26; public static void main(String[] args) { Object person = new Person(); if (person instanceof Person) System.out.print(((Person) person).age); }G }G
age = 26; public static void main(String[] args) { Object person = new Person(); if (person instanceof Person) System.out.print(((Person) person).age); }G }G
age = 26; public static void main(String[] args) { Object person = new Person(); if (person instanceof Person) System.out.print(((Person) person).age); }G }G
age = 26; public static void main(String[] args) { Object person = new Person(); if (person instanceof Person) System.out.print(((Person) person).age); }G }G
age = 26; public static void main(String[] args) { Object person = new Person(); if (person instanceof Person) System.out.print(((Person) person).age); }G }G fun main(args: Array<String>) { val person: Any = Person() if (person is Person) print(person.age) }G
age = 26; public static void main(String[] args) { Object person = new Person(); if (person instanceof Person) System.out.print(((Person) person).age); }G }G fun main(args: Array<String>) { val person: Any = Person() if (person is Person) print(person.age) }G
with result networkRequest(result) { result2 -> //Some more things to be done on result2 saveToDatabase(result2) { result3 -> //And a lot more for result3 } } }
// Perform some operations with result val result2 = async { networkRequest(result) }.await() // Some more things to be done with result2 val result3 = async { saveToDatabase(result2)} // And at last operations with result3
= loadToken(token) // Perform some operations with result val result2 = networkRequest(result) // Some more things to be done with result2 val result3 = saveToDatabase(result2) // And at last operations with result3 }
• Kotlin code can be called directly from Java and vice versa • Kotlin code can live along side Java • Projects can start using Kotlin without any changes to previous Java code and/or convert gradually •IDE makes the conversion process easier