Question
Which of the following statements are true regarding the following method?
void callMe(String... names) { }
- A. It doesn't compile.
- B. Within the method, names is an array containing Strings.
- C. Within the method, names is a list containing Strings.
- D. The method may be called only from within the enclosing class.
B.
Note
The method declaration demonstrates standard use of a variable argument list, which is accessed inside the method as an array.
PreviousNextRelated