Oracle
1Z0-809 · Question #267
Given the code fragment: if (aFile.isDirectory ()) { recDelete (aFile.getAbsolutePath ()); } else { if (aFile.getName ().endsWith (".class")) aFile.delete (); } Assume that Projects contains…
The correct answer is A. The method deletes all the .class files in the Projects directory and its subdirectories. You've hit your session limit · resets 5:20pm (America/New_York)
Question
Given the code fragment:
if (aFile.isDirectory ()) {
recDelete (aFile.getAbsolutePath ());
} else {
if (aFile.getName ().endsWith (".class"))
aFile.delete ();
}
Assume that Projects contains subdirectories that contain .class files and is passed as an argument to the recDelete () method when it is invoked.
What is the result?
Options
- AThe method deletes all the .class files in the Projects directory and its subdirectories.
- BThe method deletes the .class files of the Projects directory only.
- CThe method executes and does not make any changes to the Projects directory.
- DThe method throws an IOException.
How the community answered
(62 responses)- A85% (53)
- B3% (2)
- C10% (6)
- D2% (1)
Explanation
You've hit your session limit · resets 5:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.