Packages
Packages allow us to split code into namespaces. Any file may begin with a package declaration:
package com.packt.myproject class Foo fun bar(): String = "bar"
The package name is used to give us the fully qualified name (FQN) for a class, object, interface, or function. In the preceding example, the class Foo
has the fully qualified name com.packt.myproject.Foo
and the top level function bar
has the fully qualified name of com.packt.myproject.bar
.