Single Choice 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,917 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

Explanation

static void add(int...args){}
Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue Programming Language where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free
No Previous Next Question

Share This Question

Challenge a friend or share with your study group.