산술연산자1 07-3 연산자 오버로딩 연산자 우선순위 우선순위 분류 심볼 높음 접미사 ++ -- . ?. ? 접두사 - + ++ -- ! 라벨선언(이름@) 오른쪽 형식 : as as? 배수 * / % 첨가 + - 범위 .. 중위함수 SimpleName 엘비스 ?: 이름검사 in !in is !is 비교 = 동등성 == != 결합 && 분리 || 낮음 할당 = += -= *= /= %= package chapt7.section3 class Point(var x: Int = 0, var y: Int = 10) { operator fun plus(p: Point): Point { return Point(x+p.x, y+p.y) } operator fun dec()=Point(--x,--y) } fun main() { val p1 = Poi.. 2022. 9. 17. 이전 1 다음