📄 choice6.txt
字号:
View Assessment Result: Multiple-Choice Quiz 6
Your performance was as follows:
1.
Consider the following Java program segment.
PrintWriter fileOut = new PrintWriter(
new FileWriter("output.txt"));
If the file output.txt already exists, which of the following events will occur when the program segment is executed?
(a) A run-time error will be generated.
(b) The existing contents of output.txt will be erased.
(c) The existing contents of output.txt will be preserved.
(d) A FileAlreadyExists exception will be raised.
Correct answer is (b)
Your score on this question is: 0.00
Feedback:
See section 3.1.1 of the course notes.
(d)
--------------------------------------------------------------------------------
2.
The model part of the Model-View-Controller (MVC) paradigm embodies the
(a) abstract domain knowledge of an application
(b) list of abstract classes in an application
(c) way in which the abstract domain knowledge of an application is presented to the user
(d) automatic mechanism by which the user interface is displayed and by which events are communicated between the view and the controller
Correct answer is (a)
Your score on this question is: 0.00
Feedback:
See Chapter 16, page 474, in the course textbook.
(d)
--------------------------------------------------------------------------------
3.
Which of the following is true regarding the controller part in the Model-View-Controller (MVC) paradigm?
(a) The controller is the way in which the abstract domain knowledge of an application is presented to the user.
(b) 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.
(c) The controller is the list of abstract classes in an application.
(d) The controller is the abstract domain knowledge of an application.
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 475, in the course textbook.
(b)
--------------------------------------------------------------------------------
4.
In Java, the default layout manager for a JFrame component is
(a) GridLayout
(b) FlowLayout
(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) II and III only
(b) I and III only
(c) I, II, and III
(d) I and II only
Correct answer is (a)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 473–474, in the course textbook.
(a)
--------------------------------------------------------------------------------
6.
The ListSelectionEvent class and ListSelectionListener interface are available in the _____ package of Java.
(a) javax.swing.event
(b) java.event
(c) javax.event
(d) java.awt.event
Correct answer is (a)
Your score on this question is: 0.00
Feedback:
See Chapter 16, page 525, in the course textbook.
(d)
--------------------------------------------------------------------------------
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 actionPerformed (ListSelectionEvent lse)
(d) void valueChanged (ListSelectionEvent lse)
Correct answer is (d)
Your score on this question is: 0.00
Feedback:
See Chapter 16, page 540, in the course textbook.
(a)
--------------------------------------------------------------------------------
8.
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) I only
(c) I and II
(d) None
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 523, in the course textbook.
(c)
--------------------------------------------------------------------------------
9.
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 windowClosed (WindowEvent we)
(b) void windowAdapter (WindowEvent we)
(c) void windowDeactivated (WindowEvent we)
(d) void windowClosing (WindowEvent we)
Correct answer is (d)
Your score on this question is: 0.00
Feedback:
See Chapter 16, page 537, in the course textbook.
(a)
--------------------------------------------------------------------------------
10.
The ActionEvent class and ActionListener interface are available in the _____ package of Java.
(a) java.awt.event
(b) java.event
(c) javax.swing.event
(d) javax.event
Correct answer is (a)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 525, in the course textbook.
(a)
--------------------------------------------------------------------------------
Go to top of assessment.
Total score: 50.00
? Copyright 2006 iCarnegie, Inc. All rights reserved.
View Assessment Result: Multiple-Choice Quiz 6
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 NullPointerException will be raised.
(b) A new file will be created.
(c) A FileNotFoundException will be raised.
(d) A run-time error will occur.
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See section 3.1.1 in the course notes.
(c)
--------------------------------------------------------------------------------
2.
The view part of the Model-View-Controller (MVC) paradigm is the
(a) list of abstract classes in an application
(b) way in which the abstract domain knowledge of an application is presented to the user
(c) abstract domain knowledge of an application
(d) automatic mechanism by which the user interface is displayed and by which events are communicated between the model and the controller
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 474, in the course textbook.
(b)
--------------------------------------------------------------------------------
3.
The model part of the Model-View-Controller (MVC) paradigm embodies the
(a) way in which the abstract domain knowledge of an application is presented to the user
(b) list of abstract classes in an application
(c) automatic mechanism by which the user interface is displayed and by which events are communicated between the view and the controller
(d) abstract domain knowledge of an application
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 474, in the course textbook.
(d)
--------------------------------------------------------------------------------
4.
In Java, the default layout manager for a JFrame component is
(a) BorderLayout
(b) GridBagLayout
(c) GridLayout
(d) FlowLayout
Correct answer is (a)
Your score on this question is: 10.00
Feedback:
See Chapter 16, page 494, in the course textbook.
(a)
--------------------------------------------------------------------------------
5.
In Java, the default layout manager for a JPanel component is
(a) GridBagLayout
(b) GridLayout
(c) FlowLayout
(d) BorderLayout
Correct answer is (c)
Your score on this question is: 0.00
Feedback:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -