(Choose 1 answer)
Consider the following class:
1. class Test {
2 void foo(int i) {
3.
System.out.println("int version");
5.void foo(String s) {
4.}
6.System.out.println("String version");
7. } 8.
9. public static void main(String args[]) {
10.
11.
12.
Test t = new Test();char ch = 'p';
t.foo(ch);
13. } 14.}
Which of the following statements is true?
A. Line 5 will not compile, because void methods cannot be overridden.
B. Line 12 will not compile, because no version of foo() takes a char argument.
C. The code will compile and produce the following output: String version.
D. The code will compile and produce the following output: int version.
Exit (31