class Creature { String getName() { return "Creature"; } } class Bird extends Creature { String getName() { return "Bird"; } } class Falcon extends Bird { String getName() { return "Falcon"; } } public class Tester { public static Bird getIt(Creature c) { System.out.println(c.getName()); return (Bird) c; } public static void main(String[] args) { // insert code here } }
String getName() {
return "Creature";
}
class Bird extends Creature {
return "Bird";
class Falcon extends Bird {
return "Falcon";
public class Tester {
public static Bird getIt(Creature c) {
System.out.println(c.getName());
return (Bird) c;
public static void main(String[] args) {
// insert code here
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.