Question: Java// string is given, using switch case we turn that string into an array, now a method to count the words of the array is

Java// string is given, using switch case we turn that string into an array, now a method to count the words of the array is needed! I did it as if my input is a string and it worked but for my project i need it to read the input as an array. i will attach a picute of what i did.
Java// string is given, using switch case we turn that string into

public static void MyMethodClass1(String[] list) \{ Arrays. sort(list); System. out.print(Arrays. toString(list) + " ); public static void wordLength[(String[] list) \{ char [] ch = s.toCharArray(); for(int i=0; i&&ch[i]!=;{ str=str+ch [i]; i++; if(str. length ()>0){ System.out.println(str + "length is "+str. length ()); \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!