Write a Java Program to Print object of a class

Write a Java Program to Print object of a class

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
class Test {

}

class Main {
  public static void main(String[] args) {

    // create an object of the Test class
    Test obj = new Test();

    // print the object
    System.out.println(obj);
  }
}

Final output

Leave a Comment