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

Зміст курсу

test kotlin

test kotlin

1

kt

Main

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()) }

Все було зрозуміло?

Секція 1. Розділ 1
We're sorry to hear that something went wrong. What happened?
some-alt