99.0k views
2 votes
Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of size 10 and an integer array intArr of size 20, and that modifies the contents of myList and intArr?

1 Answer

3 votes

Answer:

"public static void passAList(ArrayList<Integer> myList, int[] intArr)", is the correct answer for the above question.

Step-by-step explanation:

Missing information :

  • The option is missing but the question states "choose from the following". The correct defining syntax is defined above.

Detailed Explantion :

  • The above question asked about syntax which takes the value of list and array as an argument.
  • It is already defined in the above syntax.
  • And the value is passed by the user at the time of function call.
  • The array list is defined by the help of the ArrayList class and the array is defined by the help of the "[]" symbol.

User Pengibot
by
6.6k points