write a function that receives a String array (array of objectsof type String) and find the total number of charachters in allstrings //String [] StrArray = {“AAA”, “B”, “CC”, “DDDDDDD”};
Solution
//Main.javapublic class Main { public static int getTotalCount(String s[]){ int count = 0; for(int i = 0;i<s.length;i++){ count += s.length; } return count; } public static void main(String args[]){ String [] StrArray = {“AAA”, “B”, “CC”, “DDDDDDD”}; System.out.println(“Total number of characters in array:
OR
OR