title: How to print out an object array that has parameters?
body: <p>Alright so this is simple enough.</p>
  
  <p>I need to print out all the parameters of an object at a specific index. However, all of the objects are displaying the memory address. I know you have to override the toString method. But I'm not quite sure where.</p>
  
  <p>Any help would be great!</p>
  
  <p>Here is my  Employee class code:</p>
  
  <pre><code>public class Employee {
  
  private String name;
  private int age;
  private String department;
  
  public String getDept(){
      return department;
  }//end dept
  
  public void setDept(String dept){
      this.department = dept;
  }//end
  
  public String getName(){
      return name;
  }//end name
  
  public void setName(String n){
      this.name = n;
  }//end
  
  public int getAge(){
      return age;
  }//end age
  
  public void setAge(int a){
      this.age = a;
  }//end
  
  public Employee (String n,int age,String dept){
  
      this.name = n;
      this.age = age;
      this.department = dept;
  
  }//end employee
  </code></pre>
  
  <p>}//end class</p>
  
  <p>and here is the code in my main method:</p>
  
  <pre><code>public class Company {
  
  
  public static void main(String [] args){
  
      Employee[] e = new Employee[13];
  
      e[0] = new Employee("Counting Guru",55,"Accounting");
      e[1] = new Employee("Counting Pro",45,"Accounting");
      e[2] = new Employee("Counting Savvy",40,"Accounting");
      e[3] = new Employee("Counting Novice",25,"Accounting");
      e[4] = new Employee("Sales Guru",50,"Marketing");
      e[5] = new Employee("Sales Pro",48,"Marketing");
      e[6] = new Employee("Sales Savvy",38,"Marketing");
      e[7] = new Employee("Hiring Guru",58,"Human Resrouces");
      e[8] = new Employee("Hiring Pro",47,"Human Resrouces");
      e[9] = new Employee("Hacking Pro",47,"Information Systems");
      e[10] = new Employee("Hacking Guru",51,"Information Systems");
      e[11] = new Employee("Hacking Savvy",38,"Information Systems");
      e[12] = new Employee("Hacking Novice",23,"Information Systems");
  
  
      for(int i = 0;i&lt;e.length;i++){
          System.out.println(e[i]);
  
      }//end 
  }//end main
  }//end company
  </code></pre>