
fun main() { val button: View = Button() button.click() } abstract class View { abstract fun click() } class Button: View() { override fun click() { println("Button") } } abstract class는 abstract fun을 가진다. abstract fun의 바디는 구현할 수 없다. fun main() { val button: View = Button() button.click() } open class View { open fun click() { println("View") } } class Button: View() { override fun click() { sup..

fun main() { val name = "Richard" println(name.lastChar()) } // 확장함수 fun String.lastChar(): Char = this[this.length - 1] // 아래와 동일 // fun String.lastChar(): Char = this.get(this.length - 1) // fun String.lastChar(): Char = get(length - 1) 수신 객체 타입(receiver type) : String.lastChar()의 String 수신 객체(receiver object) : this fun main() { val listString = listOf("A", "B", "C") val listNumber = listOf(1..

String vs StringBuffer vs StringBuilder String - 문자열 삽입, 삭제, 수정이 많지 않을 때 사용하기 적합 - 불변(immutable) 객체 - 문자열이 수정될 때마다 새로운 객체가 Heap에 생성됨 - 불변성을 가지므로 멀티 스레드 환경에서 안전 (Thread-Safe) StringBuffer - 가변(mutable) 객체 - 문자열 삽입, 삭제, 수정이 빈번하게 발생 시 사용하기 적합 - synchronized 키워드를 사용하여 멀티 스레드 환경에서 안전 (Thread-Safe) StringBuilder - 가변(mutable) 객체 - 문자열 삽입, 삭제, 수정이 빈번하게 발생 시 사용하기 적합 - 동기화를 지원하지 않음 - 단일 스레드의 성능이 StringBu..

String vs StringBuffer vs StringBuilder String - 문자열 삽입, 삭제, 수정이 많지 않을 때 사용하기 적합 - 불변(immutable) 객체 - 문자열이 수정될 때마다 새로운 객체가 Heap에 생성됨 - 불변성을 가지므로 멀티 스레드 환경에서 안전 (Thread-Safe) StringBuffer - 가변(mutable) 객체 - 문자열 삽입, 삭제, 수정이 빈번하게 발생 시 사용하기 적합 - synchronized 키워드를 사용하여 멀티 스레드 환경에서 안전 (Thread-Safe) StringBuilder - 가변(mutable) 객체 - 문자열 삽입, 삭제, 수정이 빈번하게 발생 시 사용하기 적합 - 동기화를 지원하지 않음 - 단일 스레드의 성능이 StringBu..
- Total
- Today
- Yesterday
- 안드로이드 #코틀린 #Android #Kotlin
- MVVM
- Intent
- 자바
- DataBinding
- Design Pattern
- ArrayList
- ViewModel
- 혀가 길지 않은 개발자
- recyclerview
- fragment
- Kotlin
- 코틀린
- activity
- Android
- James Kim
- ViewPager2
- Vue.js #Vue.js + javascript
- handler
- Architecture Pattern
- coroutine
- XML
- java
- Livedata
- TabLayout
- View
- 안드로이드
- JSONArray
- CoordinatorLayout
- JSONObject
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |