title: Retrieve a value from a HashSet of objects
body: <p>Hi Guys just trying to brush up on my Java skills (forgotten so much). 
  And for the life of me i cant remember how to print out a specific element from a HashSet of objects. So far ive created the objects and added them to the HashSet</p>
  
  <pre><code>    Teacher teacher1 = new Teacher("Miss Marple", 63, "English");
      Teacher teacher2 = new Teacher("Mr White", 26, "Maths");
      Teacher teacher3 = new Teacher("Mrs Janet", 46, "Science");
      Teacher teacher4 = new Teacher("Mr Hancock", 35, "Art");
      Collection&lt;Teacher&gt; staff = new HashSet&lt;Teacher&gt;();
      staff.add(teacher1);
      staff.add(teacher2);
      staff.add(teacher3);
      staff.add(teacher4);
  </code></pre>
  
  <p>Now how do i go about retrieving and printing the name variable for each teacher object? </p>
  
  <p>Thanks</p>