Question: d) Write down the exact outputs of the following program. Please explain with detailed steps. public class Qld { public static void main(String[] args)
d) Write down the exact outputs of the following program. Please explain with detailed steps. public class Qld { public static void main(String[] args) { [6 marks] } func("Abc123 Aabd2223"); public static void func(String s) { int[] array = new int[26]; for (int i = 0; i < s.length(); ++i) { char c s.charAt(i); if (!Character.isLetter(c)) continue; if (Character.isUpperCase(c)) int j; j = c - 'A'; else j=c-'a'; +array[j]; } } } int out1 = 0; int out2 = 0; for (int i=0; i out1) out1 = array[i]; if (array[i] != 0) } ++out2; System.out.println(out1); System.out.println(out2);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
