코틀린 기초 문법) 12. 코틀린 오버라이딩, 오버로딩 알아보기
오버로딩(Overloading)? 메서드(함수) 이름을 고정으로 하고 매개변수 만 다르게 함으로써 메서드를 여러개 만드는 것 자바에서 오버로딩 public class OverloadingClass { void ex(){} void ex(int x){} void ex(int x, int y){} void ex(int x, int y, int z){} void ex(String str){} void ex(String str, int x){} /* *. *.. *... *.... *..... */ } 코틀린에서 오버로딩 class OverloadingClass() { fun ex() {} fun ex(x: Int, y: Int) {} fun ex(x: Int, y: Int, z: Int) {} fun ex(s..
Kotlin
2019. 5. 24. 07:47
최근에 올라온 글
최근에 달린 댓글