추상화

    [Kotlin] 클래스 상속, 추상화, 인터페이스

    객체 - 객체는 식별자(identity), 상태(state), 행동(behavior) 을 가진 실체 클래스 class Product // 필수 파라미터 지정 class Product constructor(val categoryLabe: String) // constructor 생성자가 한 개 있을 시 생략 가능 class Product(val categoryLabel: String) // constructor 생성자가 두 개 이상 일 시 (주 생성자, 부 생성자) class Product(val categoryLabel: String) { constructor(categoryLabel: String, name: String): this(categoryLabel) } // 파라미터에 디폴트 값이 존재한다면..