title: What is toString in java
body: <pre><code>What is the function of  toString in here?
  what is the need for toString
  </code></pre>
  
  <p>can anyone please explain what toString suppose to do here. I am new in java and learning alot of new stuff</p>
  
  <pre><code>public class Employee  
      {
         private String name;
         private String address;
         private int number;
         public Employee(String name, String address, int number)
         {
            System.out.println("Constructing an Employee");
            this.name = name;
            this.address = address;
            this.number = number;
         }
  
  
  
  
       public String toString() //what is  this function doing
         {
            return name + " " + address + " " + number;
         }
  </code></pre>
  
  <h2>Heading</h2>