1z0-809 Java SE 8 Programmer II

Loading demo links...

Showing 1–3 of 15 questions

Question 1

Given:

final class Folder { //line n1

//line n2 public void open () { System.out.print(“Open”);

} } public class Test {

public static void main (String [] args) throws Exception {

try (Folder f = new Folder()) {

f.open();

}

}

}

Which two modifications enable the code to print Open Close? (Choose two.)

Select all that apply, then click Submit answer.

  • Replace line n1 with: class Folder implements AutoCloseable {

  • Replace line n1 with: class Folder extends Closeable {

  • Replace line n1 with: class Folder extends Exception {

  • At line n2, insert:
    final void close () {
    System.out.print(“Close”);
    }

  • At line n2, insert:
    public void close () throws IOException {
    System.out.print(“Close”);
    }

Question 2

Which two statements are true about the Fork/Join Framework? (Choose two.)

Select all that apply, then click Submit answer.

  • The RecursiveTask subclass is used when a task does not need to return a result.

  • The Fork/Join framework can help you take advantage of multicore hardware.

  • The Fork/Join framework implements a work-stealing algorithm.

  • The Fork/Join solution when run on multicore hardware always performs faster than standard sequential solution.

Question 3

Which two statements are true about localizing an application? (Choose two.)

Select all that apply, then click Submit answer.

  • Support for new regional languages does not require recompilation of the code.

  • Textual elements (messages and GUI labels) are hard-coded in the code.

  • Language and region-specific programs are created using localized data.

  • Resource bundle files include data and currency information.

  • Language codes use lowercase letters and region codes use uppercase letters.