Examlex

Solved

What Is Printed? Public Class Inherit

question 2

Multiple Choice

What is printed?

public class Inherit
{

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

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

void tryme(Figure f)
{
f.display( ) ;
}

Inherit( )
{
Figure f = new Line( ) ;
tryme(f) ;
}

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


Definitions:

Osama Bin Laden

The founder of al-Qaeda, the terrorist organization responsible for the September 11, 2001 attacks on the United States and other acts of terrorism.

Saudi Arabia

A country located on the Arabian Peninsula, known for its vast oil reserves and as the birthplace of Islam.

American Troops

Members of the United States armed forces who serve both domestically and internationally in various capacities and operations.

Al Qaeda

An international Islamist terrorist organization founded by Osama bin Laden, known for carrying out the September 11 attacks in 2001 and other acts of terrorism globally.

Related Questions