일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 웹크롤러
- 플러터
- DART
- map
- ML
- Class
- Collection
- kotlin
- function
- 함수
- 파이썬
- 크롤러
- crawler
- import
- Flutter
- Android
- python
- text
- texttheme
- 클래스
- animation
- pushnamed
- textstyle
- List
- 다트
- 코틀린
- set
- variable
- 콜렉션
- package
- Today
- Total
목록kotlin (41)
조용한 담장

코틀린의 인터페이스(interface) 에 대해 알아보자. 원문 https://kotlinlang.org/docs/reference/interfaces.html 을 보며 정리. interface 키워드를 사용하는 인터페이스는 추상화 메소드와 그 구현 코드를 가지고 있고 state 는 저장할 수 없다. interface MyInterface { fun bar() fun foo() { // optional body } } Implementing Interfaces 한개의 클래스나 오브젝트는 한개 이상의 인터페이스를 가질 수 있다. class Child : MyInterface { override fun bar() { // body } } Properties in Interfaces 인터페이스는 propert..

코틀린 클래스의 프로퍼티(property) 와 필드(field) 에 대해 살펴보자. 원문 https://kotlinlang.org/docs/reference/properties.html 을 보며 정리. Declaring Properties property 는 var 또는 var 로 선언된다. class Address { var name: String = "Holmes, Sherlock" var street: String = "Baker" var city: String = "London" var state: String? = null var zip: String = "123456" } fun copyAddress(address: Address): Address { val result = Address() ..

코틀린(kotlin)의 returns and jumps 를 보자. 원문 https://kotlinlang.org/docs/reference/returns.html 을 보며 정리. kotlin structural jump expressions : return, break, continue 위 세계의 표현은 Nothing type 이다. val s = person.name ?: return Break and Continue Labels expression 은 label 로 표시될 수 있으며 식별자(identifier) @ 뒤에 붙는다. 예) abc@, foobar@ 참조 : grammar for label 아래와 같이 break 나 continue 가 jump 할 대상의 label 을 expression 앞..

코틀린(kotlin) 의 control flow 부분을 살펴보자. if, when, for, while 원문 https://kotlinlang.org/docs/reference/control-flow.html 을 보며 정리. If Expression grammar for if if is an expression. kotlin 에서 if 는 control flow 를 위한 키워드일 뿐 아니라 표현식이 이기도 하다. 어떤 동작의 결과를 리턴하는 표현식으로써도 동작한다는 의미이다. val max = if (a > b) a else b if () 의 결과에 따라 max 는 a 나 b 의 값을 가진다. val max = if (a > b) { print("Choose a") a } else { print("Cho..