title: Calling toString method in Main function
body: <p>I have 3 different classes. I have to get user input by using <code>BufferedReader</code> but by using <code>toString</code> method. Below is the codes in my <code>User2</code> (one of the classes). </p>
  
  <p>How to call everything that user have input in the <code>toString</code>, at main function ? if i have to use object, how?</p>
  
  <pre><code>//in User2 class
  @Override
  public String toString() {
      try {
          //getting input using BufferedReader
  
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
          System.out.print("Enter customer name: ");
          this.name = br.readLine();
          System.out.print("Enter customer address: ");
          this.address = br.readLine();
          System.out.print("Enter customer contact no: ");
          this.hp = br.readLine();
      } catch (IOException e) {
          return "";
      }
  return "" ;
  }
  </code></pre>
  
  <p>I only know to print out everything in to string by using</p>
  
  <pre><code> System.out.println(u2.toString());
  </code></pre>
  
  <p>Thanks in advance.</p>