일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Mac
- GIT
- numpy
- google apps script
- Google Spreadsheet
- SQL
- math
- Java
- PANDAS
- dataframe
- matplotlib
- Python
- gas
- 파이썬
- PySpark
- Tkinter
- Github
- django
- Apache
- list
- c#
- PostgreSQL
- Google Excel
- Redshift
- hive
- Excel
- Kotlin
- string
- array
- Today
- Total
목록class (9)
달나라 노트
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는 아무 내용이 없었고 원래..
Original source = play.kotlinlang.org/byExample/01_introduction/01_Hello%20world Kotlin도 객체 지향 언어이기 때문에 class는 상당히 중요한 개념입니다. Class의 개념 자체에 대해선 아래 링크를 읽어봅시다. cosmosproject.tistory.com/198?category=972064 여기선 Kotlin에서 어떻게 class를 사용하는지를 중점적으로 다뤄봅시다. (미리 말씀드리면 python과 비슷하다고 느끼면 편합니다.) class EmptyClass // 1 class PeopleInfo(val name: String, var age: Int) // 2 fun main() { val emptyclass = EmptyClas..
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 Increment { public void increment(int x) { x = x + 10; } } public class JavaClass { int x = 0; public static void main(String args[]) { JavaClass test = new JavaClass(); System.out.println(test.x); Increment inc = new Increment(); inc.increment(test.x); System.out.println(test.x); } } -- Result 0 0 위 코드에서 봐야 할 것은 2가지 입니다. 첫 번째. 하나의 파일에 2개의 class가 적혀있습니다. 이것은 가능합니다. 다만 public 키워드를 붙이는 class..