data class Narayana(val Username:String,val Userid:Int,val password:Int ) fun main(args:Array<String>){ var obj=Narayana("govinda",331,123) val(Name,highscore,ranking)=obj fun funny():Triple<String,Int,Int> { return Triple("Narayana",125,225) } val (Username,Userid,password)=funny() println("the username is :$Username") println("the password is :$password") println("the userid is :$Userid") println("the name of the cricketer is :$Name") println("the highest score scored by him is :$highscore") println("the ranking of the cricketer is :$ranking") }
Write, Run & Share Kotlin code online using OneCompiler's Kotlin online compiler for free. It's one of the robust, feature-rich online compilers for Kotlin language. Getting started with the OneCompiler's Kotlin editor is easy and fast. The editor shows sample boilerplate code when you choose language as Kotlin and start coding.