Exam 12: Exceptions and Advanced File Io
Exam 1: Introduction to Computers and Java42 Questions
Exam 2: Java Fundamentals53 Questions
Exam 3: Decision Structures52 Questions
Exam 4: Loops and Files48 Questions
Exam 5: Methods50 Questions
Exam 6: A First Look at Classes49 Questions
Exam 7: A First Look at Gui Applications49 Questions
Exam 8: Arrays and the Arraylist Class52 Questions
Exam 9: A Second Look at Classes and Objects40 Questions
Exam 10: Text Processing and More About Wrapper Classes49 Questions
Exam 11: Inheritance49 Questions
Exam 12: Exceptions and Advanced File Io46 Questions
Exam 13: Advanced Gui Applications46 Questions
Exam 14: Applets and More39 Questions
Exam 15: Recursion34 Questions
Exam 16: Sorting, Searching, and Algorithm Analysis46 Questions
Exam 17: Generics50 Questions
Exam 18: Collections50 Questions
Exam 19: Array-Based Lists20 Questions
Exam 20: Linked Lists36 Questions
Exam 21: Stacks and Queues36 Questions
Exam 22: Binary Trees, Avl Trees, and Priority Queues45 Questions
Select questions type
A class must implement the Serializable interface in order for objects of the class to be serialized.
(True/False)
4.7/5
(43)
To serialize an object and write it to the file,use this method of the ObjectOutputStream class.
(Multiple Choice)
4.9/5
(36)
Look at the following code: FileInputStream fstream =
New FileInputStream("MyInfo.dat");
DataInputStream inputFile =
New DataInputStream(fstream);
This code can also be written as:
(Multiple Choice)
4.9/5
(43)
All of the exceptions that you will handle are instances of classes that extend this class.
(Multiple Choice)
4.8/5
(41)
A catch clause that uses a parameter variable of the Exception type is capable of catching any exception that extends the Error class.
(True/False)
4.7/5
(42)
All exceptions are instances of classes that extend this class.
(Multiple Choice)
5.0/5
(30)
To read data from a binary file you create objects from the following classes:
(Multiple Choice)
5.0/5
(40)
If class,SerializedClass,contains references to objects of other classes as fields,those classes must also implement the Serializable interface in order to be serialized.
(True/False)
4.8/5
(40)
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 go execute that method.
(True/False)
4.9/5
(44)
When the code in a try block may throw more than one type of exception,you need to write a catch clause for each type of exception that could potentially be thrown.
(True/False)
4.9/5
(34)
If,within one try statement you want to have catch clauses of the following types,in which order should they appear in your program: (1)Exception
(2)IllegalArgumentException
(3)RuntimeException
(4)Throwable
(Multiple Choice)
4.8/5
(36)
An exception's default error message can be retrieved using this method.
(Multiple Choice)
4.9/5
(35)
Assume that the classes BlankISBN,NegativePrice,and NegativeNumberOrdered are exception classes that inherit from Exception.The following code is a constructor for the Book class.What must be true about any method that instantiates the Book class with this constructor? public Book(String ISBNOfBook,double priceOfBook,
Int numberOrderedOfBook)throws BlankISBN,
NegativePrice,
NegativeNumberOrdered
{
If (ISBNOfBook == "")
Throw new BlankISBN();
If (priceOfBook < 0)
Throw new NegativePrice(priceOfBook);
If (numberedOrderedOfBook < 0)
Throw new NegativeNumberOrdered(numberOrderedv);
ISBN = ISBNOfBook;
Price = priceOfBook;
NumberedOrdered = numberOrderedOfBook;
}
(Multiple Choice)
4.9/5
(32)
If the IOData.dat file does not exist,what will happen when the following statement is executed? RandomAccessFile randomFile =
New RandomAccessFile("IOData.dat","rw");
(Multiple Choice)
4.8/5
(49)
In a try/catch construct,after the catch statement is executed
(Multiple Choice)
4.9/5
(40)
When you write a method that throws a checked exception,you must
(Multiple Choice)
4.8/5
(35)
Showing 21 - 40 of 46
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)