└── list /list: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class Main { 3 | public static void main(String[] args) { 4 | String[] a = new String[10]; 5 | Scanner scanner = new Scanner(System.in); 6 | int x = 0; 7 | while (x < a.length) { 8 | System.out.print("Enter a task (or type 'quit' to exit): "); 9 | String c = scanner.nextLine(); 10 | 11 | if (c.equals("quit")) { 12 | break; 13 | } 14 | 15 | a[x] = c; 16 | x++; 17 | } 18 | for (int i = 0; i < x; i++) { 19 | System.out.println((i + 1) + ". " + a[i]); 20 | } 21 | scanner.close(); 22 | } 23 | } 24 | --------------------------------------------------------------------------------