どこでも使える文字列、数値、コレクション
すべてのターゲットで同じように動作する基本stdlib型を学びます
「どこでも使える文字列、数値、コレクション」はCoddyKit上の無料Kotlin Multiplatform Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはKotlin Multiplatform Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
One Toolbox, Every Target
The Kotlin stdlib ships with the language itself, so its core types behave the same on Android, iOS, desktop and beyond.
Strings Just Work
The String type is fully multiplatform. You can declare and combine text in commonMain and trust it everywhere.
val name: String = "Ada"
val hi = "Hello, " + nameString Helpers Travel With You
Handy String functions like uppercase, trim and length all live in common code, ready on each platform.
val tidy = " hi ".trim().uppercase()Numbers Are Shared Too
Number types such as Int, Long and Double are part of common Kotlin, so your math is identical across targets.
val total: Int = 2 + 3
val price: Double = 9.99Convert Between Types
Conversions like toInt and toDouble are common-safe, letting you reshape numbers anywhere your shared code runs.
val count = "42".toInt()
val ratio = count.toDouble()Meet the List
A List holds an ordered group of items. It is multiplatform, so the same collection powers both apps.
val fruits: List<String> = listOf("apple", "pear")Sets Keep Things Unique
A Set stores each value only once. Like List, it works the same way on every Kotlin target.
val tags: Set<String> = setOf("kmp", "kmp")Maps Pair Keys and Values
A Map links keys to values. It is fully shared, so lookups behave identically across all platforms.
val ages: Map<String, Int> = mapOf("Ada" to 36)Read Items Safely
Use indexing or getOrNull to read from a list. These collection operations are common-safe across targets.
val first = fruits[0]
val maybe = fruits.getOrNull(5)Why This Matters
Because these core types are identical everywhere, you write data logic once and never worry which platform runs it. 🙂
Default to Common Types
Reach for plain String, Int, List, Set and Map first. They are the safe, portable backbone of shared Kotlin.
Quick Check
Which collection fits this need?
Recap
Core stdlib types, String, numbers, List, Set and Map, behave the same on every target, so shared data logic is rock solid.
よくある質問
「どこでも使える文字列、数値、コレクション」レッスンは無料ですか?
はい。「どこでも使える文字列、数値、コレクション」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Kotlin Multiplatform Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
「どこでも使える文字列、数値、コレクション」で何を学びますか?
すべてのターゲットで同じように動作する基本stdlib型を学びます ブラウザで直接実行するハンズオンコードでKotlin Multiplatform Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Kotlin Multiplatform Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのKotlin Multiplatform Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。
「どこでも使える文字列、数値、コレクション」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このKotlin Multiplatform Academyレッスンでコードを書いて実行できますか?
はい。すべてのKotlin Multiplatform Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- どこでも使える文字列、数値、コレクション
- 共有コードのmap、filter、fold
- kotlinx-datetimeで日付を扱う
- Common stdlibにないもの