@@ -0,0 +1,592 @@
+package homework;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.Scanner;%0A%0Apublic class SortArrayOfStrings %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner scanner = new Scanner(System.in);%0A%09%09int numberOfRows = scanner.nextInt();%0A%09%09ArrayList%3CString%3E towns = new ArrayList%3CString%3E();%0A%09%09%0A%09%09for (int i = 0; i %3C= numberOfRows; i++) %7B%0A%09%09%09String line = scanner.nextLine();%0A%09%09%09if (line != %22%22 && line != null) %7B%0A%09%09%09%09towns.add(line);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09Collections.sort(towns);%0A%09%09%0A%09%09for (String town : towns) %7B%0A%09%09%09System.out.println(town);%0A%09%09%7D%0A%09%09%0A%09%09scanner.close();%0A%09%7D%0A%7D%0A

add problem 8