Examlex

Solved

Consider the Scope of the Three Objects MenuLabel, Mi, and the Anonymous

question 72

Multiple Choice

Consider the scope of the three objects menuLabel, mi, and the anonymous object new MyMenuListener() within the JmenuItem class.How do thier lifetimes compare?
public JMenuItem makeMenuItem(final String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel) ;
class MyMenuListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
doSomethingElse() ;
System.out.println(menuLabel) ;
}
}
mi.addActionListener(new MyMenuListener() ) ;
return mi;
}


Definitions:

Investment Account

An account held at a financial institution that is used for the purpose of investing in securities such as stocks, bonds, and mutual funds.

Liabilities

Liabilities are the economic debts or responsibilities that a business has to other entities, which are to be fulfilled over time by transferring economic resources.

Equity Method

An accounting method used to assess the profits earned through an investment by recognizing income and dividends from the invested entity.

Related Questions