Zhuinden/guide-to-kotlin
소개
[가이드] Java만 알고 있지만 Kotlin을 배우고 싶은 사람을 위한 튜토리얼입니다.
학습 및 교육What you can do
- typed nullability, and null-safety operators (?., ?:)
- smart casting (and mutable vars gotcha)
- properties, backing fields
- string interpolation and """multiline escaped ${strings}"""
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- -1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalClick this link to go to the Wiki page
Guide to Kotlin
This tutorial assumes that all you know is Java, but you want to learn Kotlin.
Please note that the resources are in the wiki page.
Additional resources
A few things that are worth watching to know more about Kotlin.
More resources to read
By me: Odd things to look out for when converting code to Kotlin
By me: Code clean-up with Kotlin
By me (newer article!): An opinionated guide on how to make your Kotlin code fun to read and joy to work with
Android KTX source code: Github snapshot or AOSP (actively developed)
More resources to watch
Style-guide and reference for common mistakes to avoid
Table of Content
Major Syntax Differences
inverted argument order, no semi-colons, void vs Unit, Object vs Any?, fun
visibility in Kotlin (public by default, private, protected, internal)
backticks for reserved keywords (Mockito.when, $) and import aliases
arrayOf and arrayOfNulls and listOf and mutableListOf and linkedMapOf
there are no checked exceptions, try-with-resources as .use {}
Basic Kotlin Features
The Cool Stuff
standard library functions - scoping functions:
apply,let,also,run,withstandard library functions - more utility functions:
takeIf,takeUnless
The Tricky Stuff
Android-Specific Stuff
synthetic view accessors with kotlin android extensions (deprecated)
@Parcelize data classwith experimental kotlin android extensions
Stuff that is currently not covered, and should eventually be added in this tutorial
Coroutines, coroutines on Android,
suspend funChannels: LinkedListChannel, BroadcastChannel
@DslMarker
multi-platform things:
expectandactualcontracts
License
Copyright 2018-2020 Gabor Varadi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
관련 프로젝트 살펴보기
불러오는 중…