일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- dataframe
- GIT
- google apps script
- Redshift
- SQL
- Mac
- PySpark
- django
- Kotlin
- math
- gas
- Python
- Excel
- matplotlib
- string
- list
- Tkinter
- Java
- PANDAS
- hive
- PostgreSQL
- c#
- numpy
- Google Excel
- 파이썬
- Apache
- Github
- array
- Google Spreadsheet
- Today
- Total
목록inheritance (2)
달나라 노트
상속이란 개념은 이미 글을 올린 적이 있습니다. class의 상속 링크 -> cosmosproject.tistory.com/211 open class Test1() { // 1 val name: String = "Bella" val team: String = "Team 1" fun comment(): String { return "Test 1 class function" } } class Test2(): Test1() { // 2 } fun main() { val testing = Test2() // 3 println(testing.name) // 4 println(testing.team) // 4 println(testing.comment()) // 4 } -- Result Bella Team 1 Te..
Kotlin에서는 class를 생성할 때 여러 옵션을 줄 수 있는데 그 중 Abstract class라는 것에 대해 알아볼 예정입니다. class FirstClass() { val var_test = "test" } class SecondClass(): FirstClass() { } 위처럼 코드를 적으면 Error가 발생합니다. Error message를 보면 아래와 같습니다. This type is final, so it cannot be inherited from 이 Error가 일어나는 이유는 부모 class인 FirstClass가 open도 abstract도 아닌 일반 class이기 때문에 상속을 해줄 수 없기 때문입니다. open class FirstClass() { val var_test = ..