Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele 1 | test
test kotlin
course content

Kurssisisältö

test kotlin

test kotlin

book
1

Main.kt

Main.kt

copy
1234567891011121314151617181920
class Person(val name: String) { private val friends = mutableListOf<Person>() fun getFriends() : List<Person>{ return friends; } infix fun befriend(person: Person) { friends.add(person) println("${this.name} is now friends with ${person.name}") } } fun main() { val alice = Person("Alice") val bob = Person("Bob") alice befriend bob println(alice.getFriends()) }

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 1

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

course content

Kurssisisältö

test kotlin

test kotlin

book
1

Main.kt

Main.kt

copy
1234567891011121314151617181920
class Person(val name: String) { private val friends = mutableListOf<Person>() fun getFriends() : List<Person>{ return friends; } infix fun befriend(person: Person) { friends.add(person) println("${this.name} is now friends with ${person.name}") } } fun main() { val alice = Person("Alice") val bob = Person("Bob") alice befriend bob println(alice.getFriends()) }

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 1
some-alt