Exam 11: Inputoutput and Exception Handling
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
Consider the following code snippet: Scanner in = new Scanner(. . .);
While (in.hasNextInt())
{
) . .
}
Under which condition will the body of the while loop be processed?
(Multiple Choice)
4.8/5
(36)
Consider the following code snippet. PrintWriter outputFile = new PrintWriter("payrollReport.txt");
Which of the following statements about the PrintWriter object is correct?
(Multiple Choice)
4.8/5
(40)
When reading words using a Scanner object's next method, ____.
(Multiple Choice)
4.9/5
(35)
Select an expression to complete the program segment below, which is designed to read data from a file whose name is specified as the first command line argument. If no command line arguments are given, the program reads data from the default.txt file. String fileName = "default.txt";
If ( ________________________ )
{
FileName = args[0];
}
// additional statements to open file and read data
(Multiple Choice)
4.9/5
(41)
Which of the following statements about command line arguments is correct?
(Multiple Choice)
4.9/5
(33)
Consider the following code snippet: public void readFile(String filename) throws FileNotFoundException
{
File inFile = new File(filename);
Scanner in = new Scanner(inFile);
) . .
}
If the file cannot be located, which of the following statements about this code is correct?
(Multiple Choice)
4.7/5
(40)
Select an expression to complete the following statement, which is designed to construct a PrintWriter object to write the program output to a file named dataout.txt PrintWriter theFile = _______________________;
(Multiple Choice)
4.7/5
(35)
Consider the following code snippet: PrintWriter out = new PrintWriter("output.txt");
Which of the following statements about the PrintWriter object is correct?
(Multiple Choice)
4.9/5
(41)
Consider the following code snippet: Scanner in = new Scanner(. . .);
In)useDelimiter("[^0-9A-Za-z]+");
What characters will be ignored and not read in using this code?
(Multiple Choice)
4.8/5
(38)
Showing 101 - 109 of 109
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)