+ 1

Obscure IDE Kotlin Error - Reference MusicPlayer programming exercise Kotlin

https://code.sololearn.com/c2yu3I7n4Oej/?ref=app Can you please help me with this error, it seems to be something to do with the IDE. ?

10th Oct 2022, 12:46 PM
Sanjay Kamath
Sanjay Kamath - avatar
3 Respostas
+ 2
There are a lot of mistakes and you can compare them with your code
10th Oct 2022, 4:30 PM
SoloProg
SoloProg - avatar
+ 3
abstract class MusicPlayer(){ protected var arr = ArrayList<String>() abstract fun show() abstract fun add(name:String) } class ModelRx():MusicPlayer(){ override fun add(name :String){ arr.add(name) } override fun show(){ for (i in 0..arr.size-1) println (arr[i]) } } fun main(args: Array<String>) { val m = ModelRx() while(true) { var input = readLine()!! if(input == "stop") break m.add(input) } m.show() }
10th Oct 2022, 3:47 PM
SoloProg
SoloProg - avatar
+ 3
SoloProg Fantastic... but what was the error?
10th Oct 2022, 4:26 PM
Sanjay Kamath
Sanjay Kamath - avatar