Examlex

Solved

What Is Wrong with the Following Code

question 54

Multiple Choice

What is wrong with the following code?
class ExitListener implements ActionListener
{
public void actionPerformed(ActionEvent event)
{
System.exit(0) ;
}
}
ActionListener exitListener = new ExitListener() ;
JMenu exitMenu = new JMenu("Exit") ;
exitMenu.addActionListener(exitListener) ;
JMenuBar menuBar = new JMenuBar() ;
menuBar.add(exitMenu) ;


Definitions:

Compound Annual Rate

The rate of return that would be required for an investment to grow from its beginning balance to its ending one, compounding over a period of a year.

Compounded Annually

Describes the calculation of interest on an investment whereby the interest earned each year is added to the principal sum, leading to interest being earned on interest from the subsequent year onwards.

Monthly Compounded

Calculation of interest on the initial principal, which also includes all of the accumulated interest from previous periods on a deposit or loan, compounded every month.

RRSP

Registered Retirement Savings Plan, a Canadian account for holding savings and investment assets, with tax benefits.

Related Questions