MyClass.java
 

// Create a MyClass class
public class MyClass {
  int x;

  // Create a class constructor for the MyClass class
  public MyClass() {
    x = 5;
  }

  public static void main(String[] args) {
    MyClass myObj = new MyClass();
    System.out.println(myObj.x);
  }
}

Result:
5