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:

McLuhan

Marshall McLuhan, a media theorist known for coining the expressions "the medium is the message" and "global village," focusing on how media affects societal structures and individual perceptions.

Medium

In sociological contexts, refers to a channel of communication that influences or facilitates social interaction or the dissemination of information.

Technology Analyses

The systematic evaluation of the technical aspects, applications, implications, and impacts of technology in society.

Digital Sociality

A social landscape in which new communication technologies are promoting human interaction and contact.

Related Questions