<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">//old

class For1 {
   
   public static void main(String[] args) {      
      String[] a = {"hello","world"};
      for (int i = 0; i &lt; a.length; i++) {
         System.out.println(a[i]);
      }
   }
}

// new
class For2 {
   
   public static void main(String[] args) {      
      String[] a = {"eat","carrots"};
      for (String s : a) {
         System.out.println(s);
      }
   }
}
</pre></body></html>