What is the output of the following Java code? int al = {0,2,4,6,8,10, 12, 14, 16, 18, 20); System.out.println(a[a.lengt
Posted: Sat May 14, 2022 4:48 pm
What is the output of the following Java code? int al = {0,2,4,6,8,10, 12, 14, 16, 18, 20); System.out.println(a[a.length%3]); 0 2 O 6 QUESTION 6 tis What is the output of the following code fragment: String[] x = {"Nadia", "Salim", "Ali", "Nour", "Alia", "ali"); int L = x.length; if (x[L/2].compareTo(x[L - 1]) == 0){ System.out.println(x[2].toUpperCase()); } else { System.out.println(x[L - 1].toLowerCase()); } Fahad O ALI O Nadia ali