Question 26

Given:

What is required to make the Foo class thread safe?
  • Question 27

    Given:

    and the commands:

    What is the result on execution of these commands?
    Test.class - > java.sql -> java.base
  • Question 28

    Consider this method declaration:

    A) "SET SESSION AUTHORIZATION " + user
    B) "SET SESSION AUTHORIZATION " + stmt.enquoteIdentifier(user)
    Is A or B the correct replacement for <EXPRESSION> and why?
  • Question 29

    Given:

    You want to use the myResource class in a try-with-resources statement. Which change will accomplish this?
  • Question 30

    Given:

    What is the output?