Solved

Consider the Following Code Snippet: Public Static Void Main(String[] Args)

Question 63

Multiple Choice

Consider the following code snippet: public static void main(String[] args)
{
Order myOrder = new Order() ;
JButton button = new JButton("Calculate") ;
JLabel label = new JLabel("Total amount due") ;
) . .
Class MyListener implements ActionListener
{
Public void actionPerformed(ActionEvent event)
{
Label.setText("Total amount due " + myOrder.getAmountDue() ) ;
}
}
}
What is wrong with this code?


A) label must be declared as final.
B) myOrder must be declared as final
C) label and myOrder must be declared as final
D) label and button must be declared as final.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions