Question 19
Answer saved
Flag
question
class A {
void sum(int x, int y){
}
"
System.out.println("Sum of two numbers: +(x+y));
void sum(int y, int x) {
}
System.out.println("Sum of three numbers: " +(x+y));
public static void main(String[] args) {
}
A a = new A();
}
a.sum (20, 30);
OA. The code has a compilation error due to an undeclared class.
B. The code has a syntax error due to incorrect method calls.
OC. The code has a duplicate method error.
D. The code has a runtime error in the main method.
Clear my choice