Which of the following static methods allow an ArrayList of

Which of the following static methods allow an ArrayList of strings to be passed in as the parameter? public static void methodA(ArrayList param) {\\\\ do something} public static void methodB(ArrayList param) {\\\\ do something} methodA only methodB only both methodA and methodB

Solution

Only method B allows an arraylist of strings to be passed in as the parameter as it accepts any type which extends hasWord.

In the case of methodA, it will be required to create a new ArrayList of the type Object to pass into the method.

 Which of the following static methods allow an ArrayList of strings to be passed in as the parameter? public static void methodA(ArrayList param) {\\\\ do some

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site