title: Print the value of a Java constructor
body: <p>I am a java beginner and I am trying to get used to objects. Is there anyway that I can print out the value of a constructor in main? How can I print out the value's Kevin,20? Thanks</p>
  
  <pre><code>public class MainConstructor {
  
      public static void main(String[] args) {
  
          ConstructorClass emp1 = new ConstructorClass("Kevin", 20);
      }
  }
  </code></pre>
  
  <p>//Constructor Class</p>
  
  <pre><code>public class ConstructorClass {
  
      private String name;
      private int number;
  
      public ConstructorClass(String name, int number) {
          this.name = name;
          this.number = number;
          System.out.println("called");
      }
  }
  </code></pre>