package com.example.kotlinstudy_basic
class Human() {
//파라메터가 없는 메서드
fun born() {
println("new human is born")
}
//파라메터가 있는 메서드
fun born(name: String) {
println("${name} is born")
}
}
fun main() {
val human = Human()
human.born()
human.born("kingsCode")
}
'개발 공부' 카테고리의 다른 글
| kotlin class - multiConstructor (0) | 2025.11.04 |
|---|---|
| kotlin class - constructor (0) | 2025.11.04 |
| kotlin null (0) | 2025.11.04 |
| kotlin의 반복문 (0) | 2025.10.30 |
| kotlin의 array 와 list (0) | 2025.10.22 |