📜  返回两个值 kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:32.192000             🧑  作者: Mango

代码示例3
fun main() {
    val userFeedback = UserFeedback("Siv", "siv@tedblob.com", "Can you check this")
    
    val (name, emailId) = userFeedback
    System.out.println("emailId :" + emailId)
    System.out.println("name :" + name)
                       
}

data class UserFeedback constructor(val name: String, val emailId: String, val comments: String)