import java.io.*; ;
public class Cities {
         
   /** An entry point for program execution */
   public static void main(String[] args)  {
      String[] names = {"Addis Ababa", "Awassa","Dire Dawa","Axum"} ;
      
      try {         
         // creates a file obj representing a file
         File out = new File("cities.txt") ;
         
         // creates a writer obj
         FileWriter fw = new FileWriter(out) ;
      
         // writes the strings into the file
         for (int i=0; i < names.length; i++)
            fw.write(names[i] + '\n') ;
         
         // closes the output stream
         fw.close() ;
         
      } catch (IOException e) {     // exception handler
         System.out.println("File write failed") ;
      }
   }
}
