CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Getting started with serialization

    Kotlin SELF
    Level 47, Lesson 0
    We break down what serialization and deserialization are in Kotlin/JVM: why objects like List<Expense> need a portable form (string/bytes), why you shouldn’t treat toString() as a “storage format”, how dangerous it is to assemble JSON by hand without escaping, and why any storage scheme is a data contract (fields, types, version compatibility). At the end: a mini sketch of a file structure and typical mistakes when designing persistence.
    Available
  • JSON structure and its relation to Kotlin types

    Kotlin SELF
    Level 47, Lesson 1
    We break down the JSON “alphabet”: object {...}, array [...], primitives, and null, and map them to Kotlin types: data class, Map, List, String, Int/ Long/ Double, nullable types T?. We learn to “read JSON with our eyes,” understand nesting, and catch common mistakes in advance (quotes around keys, trailing commas, mixing up strings and numbers, null vs "null").
    Available
  • Adding kotlinx.serialization and the @Serializable annotation

    Kotlin SELF
    Level 47, Lesson 2
    We break down why serialization is needed in Kotlin projects, how kotlinx.serialization works (compiler plugin + runtime), how to correctly add kotlin("plugin.serialization") and the dependency for the JSON module, and how to apply the @Serializable annotation to models ( Expense, AppState). At the end — a quick test via serializer() and a breakdown of common mistakes.
    Available
  • Basic pipeline encode/ decode + storing JSON in a file

    Kotlin SELF
    Level 47, Lesson 3
    We break down a straightforward data-saving chain for a console Kotlin project: how to serialize an object and a list to JSON via Json.encodeToString, write the JSON string to a file ( writeText), then read it back ( readText) and restore the data via Json.decodeFromString. Separately, we discuss error diagnostics (I/O vs JSON parsing) and common pitfalls like toString(), a missing directory, and confusing {} with [].
    Available
  • Configuring Json { ... }: readability, compatibility, strictness

    Kotlin SELF
    Level 47, Lesson 4
    We break down the kotlinx.serialization.json.Json settings as part of the data storage “contract”: how prettyPrint helps with readability and diffs, how encodeDefaults affects the file’s “self-sufficiency”, why explicitNulls changes the meaning of “field is missing” vs “field = null”, and how to achieve compatibility via ignoreUnknownKeys and careful import with isLenient. At the end — a practical template for a single appJson for the entire application and a walkthrough of common mistakes.
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym