Java OCA OCP Practice Question 1225

Question

Given the following method declaration signature, which of the following is a valid call of this method?

public void call(int count, String me, String... data) 
  • A. call(9,"me",10,"Al")
  • B. call(5)
  • C. call(2,"home","sweet")
  • D. call("answering","service")


C.

Note

The method signature requires one int value, followed by exactly one String, followed by String varargs, which can be an array of String values or zero or more individual String values. Only Option C conforms to these requirements, making it the correct answer.




PreviousNext

Related