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:

Gross Profit

The difference between sales revenue and the cost of goods sold, before deducting operating expenses, interest, and taxes.

Fiscal Year

A 12-month period used for accounting purposes and planning by organizations, which may not align with the calendar year.

Ledger

A comprehensive collection of a company's financial transactions, divided into individual accounts, and recorded in a way that balances are always maintained across assets, liabilities, and equity.

Physical Inventory

The manual count of all merchandise or stock in a store or warehouse at a particular time.

Related Questions