June 2018
Intermediate to advanced
310 pages
6h 32m
English
It wouldn't be convenient to have all your classes and functions in the same folder or under the same namespace. That's the reason Kotlin, similar to many other languages, uses the notion of a package.
Like Java, Kotlin uses packages:
package me.soshin.controllers
If you're mixing Java and Kotlin, Kotlin files should follow Java package rules.
In purely Kotlin projects, common package prefixes can be omitted from the folder structure. For example, if all your projects are under the me.soshin package, place your controllers in the /controllers folder and not in the /me/soshin/controllers folder like Java does.
Read now
Unlock full access