Examlex

Solved

What Is Printed

question 26

Multiple Choice

What is printed?

public class Inherit
{

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

abstract class Rectangle extends Figure
{
}

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

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

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


Definitions:

Insemination

The intentional introduction of sperm into a female's reproductive tract for the purpose of achieving pregnancy through means other than sexual intercourse.

Embryo Transferred

A step in the in vitro fertilization process where a fertilized egg, or embryo, is placed into a woman's uterus with the goal of establishing a successful pregnancy.

Second-Stage Labor

The phase of labor during childbirth when the woman actively pushes to help the baby move down the birth canal.

Placenta

An organ that develops in the uterus during pregnancy, providing oxygen and nutrients to and removing waste from the developing fetus through the umbilical cord.

Related Questions