Varargs parameters
QuizEasy-MediumJava only
Given static int sum(int... nums) that adds its arguments, which statements are true? Pick all that apply.
sum()compiles and returns 0sum(new int[]{4, 5})compiles and returns 9static int sum(int... nums, String label)compiles- Inside the method, nums is an
int[]
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.