Solved

Consider the Following Code Snippet

Question 43

Multiple Choice

Consider the following code snippet:
Final RectangleComponent component = new RectangleComponent() ;
MouseListener listener = new MousePressListener() ;
Component.addMouseListener(listener) ;
______________
Mystery.add(component) ;
Mystery.setSize(FRAME_WIDTH, FRAME_HEIGHT) ;
Mystery.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
Mystery.setVisible(true) ;
Which of the following statements completes this code?


A) JPanel mystery = new JPanel() ;
B) JComponent mystery = new JComponent() ;
C) Frame mystery = new Frame() ;
D) JFrame mystery = new JFrame() ;

Correct Answer:

verifed

Verified

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

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents