The Playground supports 3 modes : Default, aka Regular, Tutorial and Viewer.


Regular Mode

This mode is the default mode, the UI shows the "samples" Dropdown.

var name = "Duke"; System.out.println("👋 " + name);

Lorem Ipsum. Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit.


Tutorial Mode

This mode offers a simplified UI targeting tutorial, ex. there's no "Samples dropdown, a "Reset" button to reset the snippet instead of clearing it.

A record is class declared with the `record` keyword instead of the `class` keyword, here's a working example.

record Population(int population) {} record City(String name, Population population) { // static methods are allowed in records public static City of(String name, int p) { var population = new Population(p); return new City(name, population); } } var paris = City.of("Paris", 2_161); System.out.println(paris);

For more information, make sure to check Using Record to Model Immutable Data.

The Playground also prevents the execution of some operations. We know you want to try, so here's an example.


Viewer Mode

This mode offers a minimalistic snippet viewer without a console, ex. to show code that won't compile.

public Bicycle(int startCadence, int startSpeed, int startGear) { gear = startGear; cadence = startCadence; speed = startSpeed; }

Lorem Ipsum. Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt.