Open your internet browser and search for Kotlin Playground. You’ll see different websites. Select the one provided by the Android Developers page. This web-based compiler lets you write Kotlin code and compile it to see the output on the same page.
Iveb mwa bgoccem fegpuw sbap mpa paohfu megupiex. Juo’dq cee o Sickud nifa soyc zisu figi pu ves muo lkunpat nemr jqis comzom. Kora’b bda bine:
class FruitBox<A, B, C, D>(
val firstItem: A,
val secondItem: B,
val numOfItems: C,
val totalCost: D
) {
fun printContents() {
println("FruitBox contents: First Item = $firstItem, Second Item = $secondItem")
println("Total Items = $numOfItems, Total Cost = $$totalCost")
}
}
fun main() {
val appleBananaBox = FruitBox("Apple", "Banana", 5, 10.5)
appleBananaBox.printContents()
}
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.