Learn the concept of classes and objects as the fundamentals of Java object-oriented programming (OOP).
Source Code
public class MyClass {
int x = 5;
public static void main(String[] args) {
MyClass myObj = new MyClass();
System.out.println(myObj.x);
}
}