How to create classes or objects in JAVA

How to create classes or objects in JAVA

JAVA is a Programming language like Core PHP. In this article, you will learn how to create classes or objects in JAVA.

Example:-

public class MyClass {
  int x = 10;

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

Read on Facebook

Leave A Reply