Solved

Insert the Missing Code in the Following Code Fragment

Question 45

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions