Answer (Choose 1 answer)
What is the output following the code snippet?
public class DemoClass { void add(int x, int y){
System.out.println("1. Addition is: " +(x+y));}
void add(int y, int x){
System.out.println("2. Addition is: " +(x+y));
} public static void main(String[] args){
DemoClass obj = new DemoClass ();
obj.add(20, 30);
}
}
A. Compile error
B. 2. Addition of two numbers: 50
C. 1. Addition of two numbers: 50
D. 20, 30
DIFUOn the exem