가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Chapter 3

Kotlin Syntax, Variables, Data Types, and Operators

Learn Kotlin basics in a strong foundation: variables, val vs var, primitive-like types, strings, interpolation, and everyday operators.

Inside this chapter

  1. Variables and Immutability
  2. Core Data Types
  3. Strings and Interpolation
  4. Arithmetic and Comparison Operators
  5. Type Conversion
  6. Real-World Example

Series navigation

Study the chapters in order for the clearest path from Kotlin setup and syntax to coroutines, backend work, clean design, multiplatform thinking, and advanced engineering practice. Use the navigation at the bottom to move smoothly through the full tutorial series.

Tutorial Home

Chapter 3

Variables and Immutability

val appName = "ShopSmart"
var retryCount = 0

val creates a read-only reference, while var allows reassignment. This matters because immutability reduces accidental bugs and makes program flow easier to reason about.

Chapter 3

Core Data Types

  • Int, Long, Double, Float
  • Boolean
  • Char
  • String
val age: Int = 24
val price = 499.99
val enabled = true

Kotlin has type inference, so the compiler can often determine types automatically. This keeps code shorter without making it vague.

Chapter 3

Strings and Interpolation

val user = "Asha"
val points = 120
println("User $user has $points reward points")

String interpolation makes code more readable than manual concatenation and is used constantly in logging, UI messaging, diagnostics, and generated output.

Chapter 3

Arithmetic and Comparison Operators

val total = 8 + 2
val discount = total - 1
val isLarge = total > 5
val isEqual = total == 10

Students should be comfortable with arithmetic, assignment, comparison, and logical operators because they appear in almost every program.

Chapter 3

Type Conversion

val count = 10
val asLong = count.toLong()
val asString = count.toString()

Kotlin avoids many implicit conversions. This makes data transformation more explicit and reduces hidden behavior.

Chapter 3

Real-World Example

val itemPrice = 799
val tax = 80
val finalPrice = itemPrice + tax
println("Payable amount: $finalPrice")

This kind of simple calculation grows naturally into business-rule modeling in e-commerce, finance, logistics, or analytics systems.

Copyright © 2026, WithoutBook.