MCQ Single Best Answer Not Set

QChoose all the lines which if inserted independently instead of "//insert code here" will allow the following code to compile:
public class Test{   
        public static void main(String args[]){
	        add(); 
		add(1);
		add(1, 2); 
	}

	// insert code here
}

ID: #2099 Declaration and Access Control in Java 1,869 views
Question Info
#2099Q ID
Not SetDifficulty
Declaration and Access Control in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A void add(Integer... args){}
  • B static void add(int... args, int y){}
  • C static void add(int args...){}
  • D static void add(int...args){}
Correct Answer: Option D

Explanation

static void add(int...args){}
No Previous Next Question

Share This Question

Challenge a friend or share with your study group.