#1 코드 - 코틀린 #1-1 fun main() { var testInteger : Int = 7 testInteger = testInteger.plusAndMultiply(3, 5) println("${testInteger}") // 결과로 50이 출력된다. } fun Int.plusAndMultiply(plusValue : Int, multiplyValue : Int) : Int { return (this + plusValue) * multiplyValue } 이 코드는 확장 함수(Extension functions)를 사용하는 예이다. 확장 함수란 기존 클래스의 멤버 함수인 것처럼 호출할 수 있지만, 해당 클래스에 직접 정의된 멤버가 아닌 외부에서 정의된 함수다. 확장 함수의 문법은 아주 간단하다..