일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- numpy
- math
- Tkinter
- matplotlib
- Mac
- SQL
- list
- PANDAS
- c#
- dataframe
- Redshift
- Google Excel
- GIT
- Github
- PostgreSQL
- Excel
- PySpark
- gas
- hive
- google apps script
- Java
- 파이썬
- Kotlin
- array
- Python
- Apache
- django
- string
- Google Spreadsheet
- Today
- Total
목록상속 (4)
달나라 노트
C#의 class에도 상속(Inheritance)이라는 개념이 있습니다. 상속은 어떤 class를 다른 class에 상속하게되는데 상속이라는 개념을 아주아주 심플하게 설명하면 다음과 같습니다. "내 class에 없는 내용을 다른 class로부터 복사해온다." 다음 코드를 보시죠. using System; public class Dog { public string name = "Dog"; public void hello() { Console.WriteLine("Dog Hello!"); } } public class Cat : Dog { } class MyProgram { static void Main() { Cat test_cat = new Cat(); Console.WriteLine(test_cat.na..
Original source = play.kotlinlang.org/byExample/01_introduction/01_Hello%20world open class Dog { open fun Hello() { println("Hello This is a Dog.") } } class Cat : Dog() { } fun main() { var x = Cat() x.Hello() } -- Result Hello I am Dog. Kotlin도 상속이란 개념이 있습니다. Dog class를 Cat에 상속시키고있습니다. 이것은 Cat : Dog() 처럼 세미콜론을 이용하여 가능합니다. main 함수 부분을 보면 x는 Cat class를 이용하여 객체가 되고 있습니다. Cat class는 아무 내용이 없었고 원래..
public class James extends People { public void introduce() { System.out.println("Hello. I am " + this.name + "." + "I live in " + this.planet + "."); } public static void main(String args[]) { James james = new James(); james.setName("James"); System.out.println(james.name); System.out.println(james.planet); james.introduce(); } } -- Result James Earth Hello. I am James.I live in Earth. Java cl..
class 상속과 super() Python의 class를 다룰 때 자주 언급되는 내용이 상속이라는 것인데, 과연 상속이 뭔지에 대해 한번 간단하게 알아봅시다. 먼저 class를 하나 생성해봅시다. class Parent(): def father(self): print('This is father method.') def mother(self): print('This is mother method.') parent = Parent() parent.father() parent.mother() - Output This is father method. This is mother method. Parent라는 이름의 class를 선언했고 그 class 안에는 fahter와 mother라는 함수가 존재합니다. 그..