Examlex

Solved

What Is Printed? Public Class Inherit

question 6

Multiple Choice

What is printed?

public class Inherit
{

class Figure
{
void display( )
{
System.out.println("Figure") ;
}
}

class Rectangle extends Figure
{
void display( )
{
System.out.println("Rectangle") ;
}
}

class Box extends Rectangle
{
void display( )
{
System.out.println("Box") ;
}
}

Inherit( )
{
Figure f = new Figure( ) ;
Rectangle r = new Rectangle( ) ;
Box b = new Box( ) ;
f.display( ) ;
f = r;
((Figure) f) .display( ) ;
f = (Figure) b;
f.display( ) ;
}

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


Definitions:

Stated Interest Rate

The annual interest rate declared on a bond or loan, not accounting for compounding or the effect of any fees.

Chi-square

A statistical test used to examine the differences between categorical variables in a contingency table.

Degrees of Freedom

The number of independent values or quantities which can be assigned to a statistical distribution.

Related Questions