Test #3
Which of the following is not a way a user can interact with a computer?
All of these are ways for a user to interact with a computer
In Java, there are two kinds of exceptions.
Checked and Unchecked
If your code does not handle and exception when it is thrown, this prints an error message and crashes the program.
Default exception handler
An action that takes place while a program is running is a(n) ______.
Event Handler
Programs that operate in a GUI environment must be.
Event driven
All of the exceptions that you will handle are instances of classes that extend the ________ class.
Exception
This is a section of code that gracefully responds to exceptions when they are thrown.
Exception Handler
A GUI program automatically stops executing when the end of the main method is reached. T/F
False
The BorderPane container always displays its content in five regions which are top, bottom, left, right, and center and each region must be used. T/F
False
The command line interface is an event-driven interface. T/F
False
The throws clause causes an exception to be thrown. T/F
False
To display an image in a JavaFX application, you use either the Image or ImageView class. T/F
False
To preserve an image's aspect ratio you can use the ImageView class's PreserveAspectRatio method. T/F
False
When a splash screen is displayed, the application does not load and execute until the user clicks the splash screen image with the mouse. T/F
False
When catching multiple exceptions that are related to one another through inheritance you should handle the more general exception classes before the more specialized exception classes. T/F
False
The ______ layout container arranges its contents with columns and rows.
GridPane
The ______ layout container arranges the contents into cells, similar to a spreadsheet.
GridPane
The HBox object's setPadding method takes a(n) __________as its argument.
Insets object
Beginning with Java7, to catch multiple exceptions with a single catch, you can use.
Multi-Catch
When an event takes place, the control responsible for the event creates an event.
Object
What happens if a program does not handle an unchecked exception?
The program is halted and the default exception handler handles the exception.
All exceptions are instances of classes that extend this class.
Throwable
A class must implement the Serializable interface in order for objects of the class to be serialized. T/F
True
An event handler class will not be executed unless it has been registered with the correct control. T/F
True
An event object is created when an event takes place. T/F
True
If the class SerializedClass contains references to objects of other classes as fields, those classes must also implement the Serializable interface in order to be serialized. T/F
True
Layout containers provide methods for fine-tuning the way controls are arranged. T/F
True
The call stack is an internal list of all methods that are currently executing. T/F
True
The pos type must be imported from the javafx.geometry package. T/F
True
When an exception is thrown by a method that is executing under several layers of method calls, a stack trace indicates the method executing when an exception occurred and all of the methods that were called in order to execute that method. T/F
True
When an object is serialized, it is converted into a series of bytes that contain the object's data. T/F
True
When programming in JavaFX, you should think of the GUI objects as nodes in a tree-like hierarchical structure known as a scene graph. T/F
True
When you deserialize an object using the readObject method, you must cast the return value to the desired class type. T/F
True
A file that contains raw binary data is known as a(n).
binary file
A(n) __________ is an action that takes place in an application, such as the clicking of a button.
event
A(n) ________ is an object that is generated in memory as the result of an error or an unexpected event.
exception
When you write a method that throws a checked exception, you must ________.
have a throws clause in the method header
Which of the following import statements is required in order to create a BorderPane layout container?
import javafx.scene.layout.BorderPane;
One important difference between the command line interface and a GUI interface is that _____.
in a GUI environment the user determines the order in which things happen while the user has no control over the order or events in a command line interface
To display an image in a JavaFX application you must.
include both the Image and the ImageView classes
When an exception is thrown.
it must be handled by the program or by the default exception handler
When writing a string to a binary file or reading a string from a binary file, it is recommended that you use.
methods that use UTF-8 encoding
For this question, assume myView references an ImageView object. In order to preserve the image's aspect ratio (so it does not appear stretched or distorted), you should use which of the following?
myView.setPreserveRatio(true);
In order to leave 15 pixels of space in an HBox container, use which of the following statements?
myhbox.setPadding(new Insets(15));
The process of connecting an event object to a control is called _______ the event handler.
registering
To add padding to an HBox you can call the ________ method.
setpadding
The Application class's ______method is the main entry point for a JavaFX application.
start
The catch clause__________.
the catch clause does all of these
In a try/catch construct, after the catch statement is executed.
the program resumes at the statement that immediately follows the try/catch construct
A(n) ________ contains one or more statements that are executed and can potentially throw an exception
try block