Oracle
1Z0-819 · Question #27
Given: public class Main { public static void checkConfiguration(String filename) { File file = new File(filename); if(!file.exists()) { throw new Error("Fatal Error: Configuration File, " +…
The correct answer is C. Exception in thread "main" java.lang.Error:Fatal Error: Configuration File, App.config, is missing. See the full explanation below for the reasoning.
Question
Given:
public class Main {
public static void checkConfiguration(String filename) {
File file = new File(filename);
if(!file.exists()) {
throw new Error("Fatal Error: Configuration File, "
- filename + ", is missing."); } }
Options
- AConfiguration is OK.
- BThe compilation fails.
- CException in thread "main" java.lang.Error:Fatal Error: Configuration File, App.config, is missing.
- Dnothing
How the community answered
(26 responses)- A8% (2)
- B19% (5)
- C69% (18)
- D4% (1)
Community Discussion
No community discussion yet for this question.