The getValue() method is overridden in two ways. Which one is correct?
```
I:
public class Test {
public static void main(String[] args) {
A a = new A();
System.out.println(a.getValue());
}
}
class B {
public String getValue() {
return "Any object";
}
}
class A extends B {
public Object getValue() {
return "A string";
}
}
II:
public class Test {
public static void main(String[] args) {
A a = new A();
System.out.println(a.getValue());
}
}
class B {
public Object getValue() {
return "Any object";
}
}
class A extends B {
public String getValue() {
return "A string";
}
}
```
a. I
b. II
c. Both I and II
d. Neither
b. II
You might also like to view...
There are ____ main file formats involved in creating a Flash video.
A. one B. two C. three D. four
If a balanced binary search tree contains 10 elements, then what is its depth?
a. 3 b. 2 c. 4 d. This cannot be determined – it depends on the elements and the order of their insertion
Data can be copied from Excel and pasted into an Access table
Indicate whether the statement is true or false
Which of the following HTML tags defines table cell data?
A.
C.
D.