Examlex

Solved

Why Doesn't the Following Code Compile Correctly? Import Java

question 21

Multiple Choice

Why doesn't the following code compile correctly? import java.awt.*;
Import java.awt.event.*;
Import javax.swing.*;
Public class ColorCheckBoxWindow extends JFrame
{
Private JCheckBox greenCheckBox;
Private final int WINDOW_WIDTH = 300,WINDOW_HEIGHT = 100;
Public ColorCheckBoxWindow()
{
SetTitle("Green Check Box") ;
SetSize(WINDOW_WIDTH,WINDOW_HEIGHT) ;
SetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
GreenCheckBox = new JCheckBox("Green") ;
GreenCheckBox.addItemListener(new CheckBoxListener() ) ;
SetLayout(new FlowLayout() ) ;
Add(greenCheckBox) ;
SetVisible(true) ;
}
Public void itemStateChanged(ItemEvent e)
{
If (e.getSource() == greenCheckBox)
{
System.exit(0) ;
}
}
}


Definitions:

Subsurface Rights

Legal rights to the minerals, oil, gas, and other resources located below the surface of a piece of property.

Surface Subsides

The phenomenon of ground levels sinking or settling, which can result from natural processes or human activities such as mining or excessive groundwater extraction.

Profit

The financial gain achieved when the amount earned from a business activity exceeds the expenses, costs, and taxes involved in sustaining the activity.

Harvest

The process or period of gathering in crops.

Related Questions