Multiple Choice
Insert the missing code in the following code fragment. This fragment is intended to allow the user to select a file to be opened. JFileChooser chooser = new JFileChooser() ;
Scanner in = null;
If (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)
{
File selectedFile = __________;
In = new Scanner(selectedFile) ;
) . .
}
A) chooser.getFileName()
B) chooser.getSelectedFileName()
C) chooser.getFilePath()
D) chooser.getSelectedFile()
Correct Answer:

Verified
Correct Answer:
Verified
Q40: Which method of an exception object will
Q41: Which return value of the JFileChooser object's
Q42: Insert the missing code in the following
Q43: Consider the following code snippet: Scanner in
Q44: Consider the following code snippet: try<br>{<br>PrintWriter outputFile
Q46: Insert the missing code in the following
Q47: Consider the following code snippet. File inputFile
Q48: Which method of the JFileChooser object will
Q49: Insert the missing code in the following
Q50: In the hierarchy of Exception classes, the