Given:
3. class Dog { /*from www.ja v a 2 s.c o m*/ 4. public void bark() { System.out.print("woof "); } 5. } 6. class Hound extends Dog { 7. public void sniff() { System.out.print("sniff "); } 8. public void bark() { System.out.print("howl "); } 9. } 10. public class Main { 11. public static void main(String[] args) { new Main().go(); } 12. void go() { 13. new Hound().bark(); 14. ((Dog) new Hound()).bark(); 15. ((Dog) new Hound()).sniff(); 16. } 17. }
What is the result?
Choose all that apply.
F is correct.
Class Dog doesn't have a sniff method.