Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6712429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:15:31+00:00 2026-05-26T08:15:31+00:00

Hey everyone I’m studying for a midterm exam and I’m studying the sample midterm

  • 0

Hey everyone I’m studying for a midterm exam and I’m studying the sample midterm from a previous semester, the answers are given but I’m trying to figure out how the answers came about. Question and answers below, I understand how he got “zero” but not the rest:

Write the 10-lines output of the program Bird.java shown below.

interface Silly {
   public void narf();
   public void poit(Silly s);
}

public class Bird implements Silly {
public static void main(String args[]) {
     System.out.println("zero");
     Silly s = new SillyBird(1);
     Silly s2 = new Loony();
     s.poit(s2);
     s2.poit(s);
     System.out.println("zymurgy");
   }
   public Bird() {
     this(0);
     System.out.println("zircon");
   }
   public Bird(int i) {
     System.out.println("zanzibar");
   }
   public void narf() {
     System.out.println("zort");
   }
   public void poit(Silly s) {
      s.narf();
   }
}

class SillyBird extends Bird {
   public SillyBird() {
     System.out.println("duchess");
   }
   public SillyBird(int i) {
      super(i);
   }
   public void narf() {
      System.out.println("drum");
      super.narf();
   }
}

class Loony extends SillyBird {
   public Loony() {
      System.out.println("stupendous");
   }
   public void narf() {
     System.out.println("snark");
   }
}

His answers are: zero
zanzibar
zanzibar
zircon
duchess
stupendous
snark
drum
zort
zymurgy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:15:32+00:00Added an answer on May 26, 2026 at 8:15 am
    interface Silly {
       public void narf();
       public void poit(Silly s);
    }
    
    public class Bird implements Silly {
    public static void main(String args[]) {
         System.out.println("zero");   // 1. zero
         Silly s = new SillyBird(1);   // 2. zanzibar
         Silly s2 = new Loony();       // 3. zanzibar zircon duchess stupendous
         s.poit(s2);                   // 4. snark
         s2.poit(s);                   // 5. drum zort
         System.out.println("zymurgy");// 6. zymurgy
       }
       public Bird() {
         this(0);
         System.out.println("zircon");
       }
       public Bird(int i) {
         System.out.println("zanzibar");
       }
       public void narf() {
         System.out.println("zort");
       }
       public void poit(Silly s) {
          s.narf();
       }
    }
    
    class SillyBird extends Bird {
       public SillyBird() {
         System.out.println("duchess");
       }
       public SillyBird(int i) {
          super(i);
       }
       public void narf() {
          System.out.println("drum");
          super.narf();
       }
    }
    
    class Loony extends SillyBird {
       public Loony() {
          System.out.println("stupendous");
       }
       public void narf() {
         System.out.println("snark");
       }
    }
    

    I hope this helps… I think the most important one to understand is number 3 where you have implicit super() calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey everyone, I am trying to run the following program, but am getting a
Hey everyone, I am trying to figure out a way to query my mysql
Hey everyone, So, I'm currently trying the implement the APNG Specification , but am
Hey everyone. I'm trying to make a swing GUI with a button and a
Hey everyone, I made sure there wasn't a similar discussion before posting but forgive
Hey everyone - I cant seem to figure out what i am doing wrong
Hey everyone, I am trying to ( temporarily! ) do some ASP.NET and C#
Hey everyone. I am trying to incorporate a simple UINavigationController into my tab bar
Hey everyone i am trying to write this code and I am having problems
Hey everyone, I have a database result that returns from a method. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.