1z0-819 Java SE 11 Developer

Loading demo links...

Showing 13–15 of 15 questions

Question 13

Given the code fragment:

You want to examine whether path is a directory. Which code inserted on line 1 will accomplish this?

Select an option, then click Submit answer.

  • BasicFileAttributes attributes = Files isDirectory (path);

  • BasicFileAttributes attributes =Files.getAttribute (path, ‘’insdirectory’’);

  • BasicFileAttributes attributes = Files.readAttributes(path, BasicFileAttributes.class

  • BasicFileAttributes attributes = Files, readAttributes (path, FileAttributes, class);


Question 14

Given:

When is the readObject method called?

Select an option, then click Submit answer.

  • before this object is deserialized

  • after this object is deserialized

  • before this object Is serialized

  • The method is never called.

  • after this object is serialized


Question 15

Given these declarations:

and these two code fragments:

Fragment 1:

Fragment 2:

Which code fragment is preferred and why?

Select an option, then click Submit answer.

  • Fragment 1 because it is shorter.

  • Fragment 2 because it prevents SQL injection.

  • Fragment 2 because it explicitly specifies the SQL types of the column values.

  • Fragment 1 because it is more performant.