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

Computer Science & Information Technology

You might also like to view...

If a port allows for data to be sent one bit at a time, it is a parallel port.

a. true b. false

Computer Science & Information Technology

While the first ________ diagram helps the systems analyst grasp basic data movement, its general nature limits its usefulness.

A) context B) concept C) user interface D) design

Computer Science & Information Technology