Oracle
1Z0-805 · Question #34
1Z0-805 Question #34: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #34. The question stem and answer options stay visible for context.
Question
Given the code fragment: private static void copyContents (File source, File target) { try {inputStream fis = new FileInputStream(source); outputStream fos = new FileOutputStream (target); byte [] buf = new byte [8192]; int i; while ((i = fis.read(buf)) != -1) { fos.write (buf, 0, i); Oracle 1Z0-805 Exam } //insert code fragment here. Line ** System.out.println ("Successfully copied"); } Which code fragments, when inserted independently at line **, enable the code to compile?
Options
- A}catch (IOException | NoSuchFileException e) {
- B} catch (IOException | IndexOutOfBoundException e) {
- C} catch (Exception | IOException | FileNotFoundException e ) { System.out.println(e);
- D} catch (NoSuchFileException e ) {
- E} catch (InvalidPathException | IOException e) {
Unlock 1Z0-805 to see the answer
You've previewed enough free 1Z0-805 questions. Unlock 1Z0-805 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.