Question:

Which of the following is true?

public class Base {
  public String toString() {
    return "Base";
  }
}

public class Derived extends Base {
  public String toString() {
    return "Derived";
  }
}

public class Main {
  public static void main(String[] args) {
    Base b = new Derived();
    System.out.println(b);
  }
}

Answers:


Keywords:

© 2017 QuizBucket.org