Oracle
1Z0-809 · Question #267
1Z0-809 Question #267: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #267. The question stem and answer options stay visible for context.
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.
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.