← Back to Documentation Hub

Implicit Global Imports

To maximize development speed and eliminate syntax friction, KopiLang features an un-configurable, global import architecture. The most common enterprise Java packages are permanently in scope, meaning you never have to write an import statement for core utilities.

Automatically Included Packages

The following packages are natively injected into every single .kpi compilation scope and cannot be disabled:

Implicit Java Package What It Unlocks For You Natively
java.util.* Data structures like ArrayList, HashMap, and the Scanner class.
java.io.* & java.nio.* File system utilities, input/output streams, and modern path manipulations.
java.net.* Networking interfaces, URL formatting, and socket management utilities.
java.math.* High-precision mathematical computations via BigInteger and BigDecimal.
java.time.* Modern date, time, and timezone engines (e.g., LocalDate, Instant).

Implementation Example

In standard Java, utilizing a dynamic array list requires manual imports at the very top of your source file. In KopiLang, you can declare and initialize it instantly right inside your logic:

pub stc main(String[] args) {
    # No import statement required on the top! java.util.* is implicit
    var list = new ArrayList<String>()
    list.add("Espresso")
    list.add("Barako")
    
    println(list.getFirst())
}