nerdexam
Oracle

1Z0-805 · Question #92

Given: import java.io.IOException; import java.io.file.Path; import java.io.file.Paths; public class Path12 { public static void main(String s[]) throws IOException { Path path =…

The correct answer is A. false. See the full explanation below for the reasoning.

Question

Given:

import java.io.IOException; import java.io.file.Path; import java.io.file.Paths; public class Path12 { public static void main(String s[]) throws IOException { Path path = Paths.get("\sales\quarter\..\qtrlreport.txt"); path.relativize(Paths.get("\sales\annualreport.txt")); if(path.endsWith("annualreport.txt")) { System.out.println(true); } else { System.out.println(false); } System.out.println(path); } } What is the result?

Options

  • Afalse
  • Bfalse
  • Ctrue
  • Dtrue

How the community answered

(51 responses)
  • A
    84% (43)
  • B
    10% (5)
  • C
    4% (2)
  • D
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-805 Practice