Examlex

Solved

What Is Printed by the Following Code

question 69

Multiple Choice

What is printed by the following code?
public class Inherit
{

abstract class Speaker
{
abstract public void speak( ) ;
}
class Cat extends Speaker
{
public void speak( )
{
System.out.println("Woof!") ;
}
}

class Dog extends Speaker
{
public void speak( )
{
System.out.println("Meow!") ;
}
}

Inherit( )
{
Speaker d = new Dog( ) ;
Speaker c = new Cat( ) ;
d.speak( ) ;
c.speak( ) ;
}

public static void main(String[ ] args)
{
new Inherit( ) ;
}
}


Definitions:

Parliamentary Procedure

A time-tested method for planning and running effective meetings; the best-known guide to this procedure is Robert’s Rules of Order.

Mobile Device

A portable computing device such as a smartphone or tablet that has wireless internet capabilities.

Designated Leader

An individual who has been officially assigned or chosen to lead and guide a group or team.

Parliamentary Procedure

A set of rules and guidelines used to conduct meetings and make decisions in a fair, orderly, and efficient manner.

Related Questions