Skip to main content
The standard code-interpreter template includes a Java Jupyter kernel.
result = sandbox.run_code("""
int total = 0;
for (int value : new int[] {1, 2, 3}) {
    total += value;
}
total
""", language="java")

print(result.results[0].text)
Use Java contexts for snippets that should share definitions across executions.