Single Choice Not Set

QWhat is the output of the program?
class Test{ 
        public int display(int x, int y){ 
                return ("The sum of x and y is " + x + y); 
        } 

        public static void main(String args[]){ 
                Test test = new Test();
                System.out.println(test.display(4,5)); 
        } 
}

ID: #2178 Java Constructor and Methods 1,797 views
Question Info
#2178Q ID
Not SetDifficulty
Java Constructor and MethodsTopic

Choose the Best Option

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

  • A The sum of x and y is 9
  • B The sum of x and y is 45
  • C does not compile
  • D None of the above
Correct Answer

Explanation

does not compile

Share This Question

Challenge a friend or share with your study group.