java classes 2fobjects

Solutions on MaxInterview for java classes 2fobjects by the best coders in the world

showing results for - "java classes 2fobjects"
Leo
13 Apr 2019
1public class Main {
2  int x = 5;
3
4  public static void main(String[] args) {
5    Main myObj1 = new Main();  // Object 1
6    Main myObj2 = new Main();  // Object 2
7    System.out.println(myObj1.x);
8    System.out.println(myObj2.x);
9  }
10}
11 
12 
13