local function Kotlin


class User(val id: Int, val name: String, val address: String)

fun saveUser(user: User) {
fun validate(value: String, fieldName: String) {
if (value.isEmpty()) {
throw IllegalArgumentException("Can't save User ${user.id}: empty $fieldName")
}
}
validate(user.name,"Name")
validate(user.address,"Address")
}

덧글

댓글 입력 영역