title: Why i can't get an elements from Set by using For Loop?
body: <p>I have a problem in my mind, why i can't get an element from Set by using normal For Loop, but when i use Enhanced For Loop all things work normal.
  Example :</p>
  
  <pre class="lang-java prettyprint-override"><code>private static Set&lt;HeavenlyBody&gt; planets = new HashSet&lt;&gt;();
  
  for (HeavenlyBody getPlanet : planets){
       System.out.println("\t"+getPlanet.getName()+": "+getPlanet.getOrbitalPeriod());
  }
  </code></pre>
  
  <p>How getPplanet object in Enhanced For Loop can get the element if Set doesn't have that technique? and how can i do it by normal For Loop?
  Best Regards</p>