What is the output of the following Java program?
public class Main {
static class A {
void f(Object o) { System.out.print("O"); }
void f(String s) { System.out.print("S"); }
}
public static void main(String[] args) {
A a = new A();
Object o = "x";
a.f(o); a.f("x"); a.f(null);
}
}- AOOO
- BOSO
- CSSS
- DOSS
Correct answer: D