Calling Java

Java constructors and methods are directly available.

Example.kalm
use java.time.LocalDate

pub fun tomorrow() -> Text:
    return LocalDate.now().plusDays(1L).toString()
Example.kalm
use java.time.LocalDate

pub fun tomorrow() -> Text {
    return LocalDate.now().plusDays(1L).toString()
}
Example.kalms
use java.time.LocalDate

fun tomorrow() -> Text:
    return LocalDate.now().plusDays(1L).toString()
Example.kalms
use java.time.LocalDate

fun tomorrow() -> Text {
    return LocalDate.now().plusDays(1L).toString()
}
Example.java
import java.time.LocalDate;

public final class Example {
    public static String tomorrow() {
        return LocalDate.now().plusDays(1L).toString();
    }
}

Learn more.