Java SE 8 Programmer II Practice Questions - Oracle Certified Professional, Java SE 8 Programmer II (Exam 1Z0-809) Exam

Access More Questions
Given: class Animal { String speak() { return "..."; } } class Dog extends Animal { @Override String speak() { return "Woof"; } } Animal a = new Dog(); String s = a.speak(); What is the value of s, and why?
Correct Answer:
"Woof" because virtual method invocation uses the runtime type Dog

Access more questions from this quiz

Continue to Java SE 8 Programmer II Practice Questions - Oracle Certified Professional, Java SE 8 Programmer II (Exam 1Z0-809) Exam for more practice questions and the full quiz experience.

Access More Questions