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

Computer Science & Information Technology

You might also like to view...

Graded-index fiber was developed to do which of the following?

A) Enable WDM applications B) Overcome pulse-dispersion problems C) Overcome OH peaks D) Increase bandwidth

Computer Science & Information Technology

Which of the following is a top-level digital certificate in the PKI chain?

A. security-aware resolver B. trust anchor C. DNSSEC resolver D. RRSIG record

Computer Science & Information Technology