📄 choice6.txt
字号:
See Chapter 16, page 494, in the course textbook.
(b)
--------------------------------------------------------------------------------
6.
In Java, what is the signature of the method in the WindowListener interface where code is to be added to end a program when the close button is pressed?
(a) void windowDeactivated (WindowEvent we)
(b) void windowClosing (WindowEvent we)
(c) void windowClosed (WindowEvent we)
(d) void windowAdapter (WindowEvent we)
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 537, in the course textbook.
(b)
--------------------------------------------------------------------------------
7.
Which of the following is a Java event that is generated when the close button on a JFrame component is pressed?
(a) DisposeEvent
(b) CloseEvent
(c) ExitEvent
(d) WindowEvent
Correct answer is (d)
Your score on this question is: 0.00
Feedback:
See Chapter 16, page 534, in the course textbook.
(b)
--------------------------------------------------------------------------------
8.
Which of the following is a Java event that is generated when a JButton component is pressed?
(a) ButtonEvent
(b) ClickEvent
(c) ActionEvent
(d) WindowEvent
Correct answer is (c)
Your score on this question is: 0.00
Feedback:
See Chapter 16, page 525, in the course textbook.
(a)
--------------------------------------------------------------------------------
9.
What is the signature of the method specified in the Java ActionListener interface?
(a) void actionListener (ActionEvent ae)
(b) void actionEvent (ActionPerformed ap)
(c) void actionPerformed (ActionEvent ae)
(d) void actionPerformed (ActionListener al)
Correct answer is (c)
Your score on this question is: 0.00
Feedback:
See Chapter 16, page 527, in the course textbook.
(a)
--------------------------------------------------------------------------------
10.
What is the signature of the method specified in the Java ListSelectionListener interface?
(a) void valueChanged (ListSelectionEvent lse)
(b) void valueChanged (ListSelectionListener lsl)
(c) void actionPerformed (ListSelectionEvent lse)
(d) void ListSelectionListener (ListSelectionEvent lse)
Correct answer is (a)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 540, in the course textbook.
(a)
--------------------------------------------------------------------------------
Go to top of assessment.
Total score: 60.00
? Copyright 2006 iCarnegie, Inc. All rights reserved.
Your performance was as follows:
1.
If a file opened for reading does not exist, which of the following events will occur in Java?
(a) A run-time error will occur.
(b) A new file will be created.
(c) A FileNotFoundException will be raised.
(d) A NullPointerException will be raised.
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See section 3.1.1 in the course notes.
(c)
--------------------------------------------------------------------------------
2.
Which of the following is true regarding the controller part in the Model-View-Controller (MVC) paradigm?
(a) The controller is the list of abstract classes in an application.
(b) The controller is the abstract domain knowledge of an application.
(c) The controller is the automatic mechanism by which the user interface is displayed and by which events are communicated between the model and the view.
(d) The controller is the way in which the abstract domain knowledge of an application is presented to the user.
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 475, in the course textbook.
(c)
--------------------------------------------------------------------------------
3.
What is the number of regions into which the BorderLayout in Java subdivides a container?
(a) 8
(b) 2
(c) 5
(d) 4
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 494, in the course textbook.
(c)
--------------------------------------------------------------------------------
4.
In Java, the default layout manager for a JFrame component is
(a) FlowLayout
(b) GridLayout
(c) BorderLayout
(d) GridBagLayout
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 494, in the course textbook.
(c)
--------------------------------------------------------------------------------
5.
Which of the following is (are) true regarding containers and components in the context of java GUI?
A container can be added to a component.
A component can be added to a container.
A container can be added to another container.
(a) I and II only
(b) II and III only
(c) I, II, and III
(d) I and III only
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 473–474, in the course textbook.
(b)
--------------------------------------------------------------------------------
6.
The ListSelectionEvent class and ListSelectionListener interface are available in the _____ package of Java.
(a) java.awt.event
(b) javax.swing.event
(c) java.event
(d) javax.event
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 525, in the course textbook.
(b)
--------------------------------------------------------------------------------
7.
What is the signature of the method specified in the Java ListSelectionListener interface?
(a) void ListSelectionListener (ListSelectionEvent lse)
(b) void valueChanged (ListSelectionListener lsl)
(c) void valueChanged (ListSelectionEvent lse)
(d) void actionPerformed (ListSelectionEvent lse)
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 540, in the course textbook.
(c)
--------------------------------------------------------------------------------
8.
What is the signature of the method specified in the Java ActionListener interface?
(a) void actionListener (ActionEvent ae)
(b) void actionEvent (ActionPerformed ap)
(c) void actionPerformed (ActionListener al)
(d) void actionPerformed (ActionEvent ae)
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 527, in the course textbook.
(d)
--------------------------------------------------------------------------------
9.
Which of the following is (are) true regarding event handling in Java?
When a GUI component is created, the component automatically has the ability to generate events during user interaction.
Each Listener object must be registered with the specific component object or objects for which the Listener object is to respond.
(a) II only
(b) None
(c) I only
(d) I and II
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 523, in the course textbook.
(d)
--------------------------------------------------------------------------------
10.
In Java, what is the signature of the method in the WindowListener interface where code is to be added to end a program when the close button is pressed?
(a) void windowClosing (WindowEvent we)
(b) void windowDeactivated (WindowEvent we)
(c) void windowClosed (WindowEvent we)
(d) void windowAdapter (WindowEvent we)
Correct answer is (a)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 537, in the course textbook.
(a)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -