Run ❯
Get your
own Java
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
// Create a Main class public class Main { int x; // Create a class constructor for the Main class public Main() { x = 5; } public static void main(String[] args) { Main myObj = new Main(); System.out.println(myObj.x); } }
5