Examlex

Solved

"Class Aggregate" Is Incorrect

question 54

Multiple Choice

"class Aggregate" is incorrect. Choose the correct line so that this program prints Granite: weight=25.0 value=4 numKind=7
Public class Inherit
{
Abstract class Stone
{
Protected float weight = 13;
Protected int value = 4;
Abstract public String toString( ) ;
}
Class Aggregate
{
Protected int numKind;
}
Class Granite extends Aggregate
{
Granite( )
{
Weight = 25; numKind = 7;
}
Public String toString( )
{
Return "Granite: weight="
+ weight + " value="
+ value + " numKind="
+ numKind;
}
}
Inherit( )
{
Granite g = new Granite( ) ;
System.out.println(g) ;
}
Public static void main(String[ ] args)
{
New Inherit( ) ;
}
}


Definitions:

Profit

The financial gain obtained when the revenue generated from a business activity exceeds the expenses, taxes, and costs involved in sustaining the activity.

Dollar Sales Revenue

The sum of all revenue earned from selling goods or services prior to subtracting any costs or expenses.

Market Share

The slice of a market under the control of a particular company or product.

Unit Sales

The total number of individual items or units sold within a specific timeframe.

Related Questions