This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
fun main() { | |
val length = readLine()?.toIntOrNull() ?: 0 | |
val input = mutableListOf<Int>() | |
repeat(length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
fun main() { | |
val length = readLine()?.toIntOrNull() ?: 0 | |
val input = mutableListOf<Int>() | |
repeat(length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"title": "Pulp Fiction", | |
"imageUrl": "https://upload.wikimedia.org/wikipedia/en/3/3b/Pulp_Fiction_%281994%29_poster.jpg", | |
"actresses": ["Uma Thurman", "Mia Wallace", "John Travolta"] | |
}, | |
{ | |
"title": "The Matrix", | |
"imageUrl": "https://upload.wikimedia.org/wikipedia/en/c/c1/The_Matrix_Poster.jpg", | |
"actresses": ["Keanu Reeves", "Carrie-Anne Moss", "Laurence Fishburne"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"response": [ | |
{ | |
"name" : "Solna", | |
"phoneNumber" : "084555300", | |
"address" : "Rättarvägen 3, 169 68 Solna" | |
}, | |
{ | |
"name" : "Kista", | |
"phoneNumber" : null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"username": "Ali, | |
"passwordHash": 46792755 | |
}, | |
{ | |
"username": "Yauheni, | |
"passwordHash": 1450575459 | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"response": [ | |
{ | |
"id": 1, | |
"name": "Parking Spot 1", | |
"area": "SOLNA", | |
"description": "Description of Parking Spot 1", | |
"isActive": true, | |
"latitude": 55.8275, | |
"longitude": 14.5693 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Animal(val name: String) { | |
fun move() { | |
// Imp | |
} | |
abstract fun eat() | |
} | |
class Bird (name: String) : Animal(name) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Something { | |
var number: Int = 0 | |
get() { | |
println("someone is trying to read number") | |
return field | |
} | |
set(input: Int) { | |
println("someone is trying to change number") | |
if (input >= 0) | |
field = input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Something { | |
fun doSth() { | |
println("no number") | |
} | |
fun doSth(input: Int) { | |
println(input) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class Parent() { | |
open fun doSth() { | |
print("I'm Parent") | |
} | |
} | |
class Child() : Parent() { | |
override fun doSth() { | |
print("I'm Child") | |
} |
NewerOlder