1z0-819 Practice Test

1z0-819 Practice Test practice questions, page 2 of 9, with answer review and explanations.

Question 6

Given the code fragment: You want to display the value of currency as $100.00. Which code inserted on line 1 will accomplish this?

  1. NumberFormat formatter = NumberFormat.getInstance(locale).getCurrency();
  2. NumberFormat formatter = NumberFormat.getCurrency(locale);
  3. NumberFormat formatter = NumberFormat.getInstance(locale);
  4. NumberFormat formatter = NumberFormat.getCurrencyInstance(locale);

Question 7

Which three initialization statements are correct? (Choose three.)

  1. int[][][] e = {{1,1,1},{2,2,2}};
  2. short sh = (short)’A’;
  3. float x = 1f;
  4. byte b = 10; char c = b;
  5. String contact# = “(+2) (999) (232)”;
  6. int x = 12_34;
  7. boolean false = (4 != 4);

Question 8

Your organization makes mlib.jar available to your cloud customers. While working on a new feature for mlib.jar, you see that the customer visible method public void enableService(String hostName, String portNumber) executes this code fragment and you see this grant is in the security policy file: What security vulnerability does this expose to your cloud customer's code?

  1. privilege escalation attack against the OS running the customer code
  2. SQL injection attack against the specified host and port
  3. XML injection attack against any mlib server
  4. none because the customer code base must also be granted SocketPermission
  5. denial of service attack against any reachable machine

Question 9

Given: and What is the result?

  1. Joe - null
  2. null Mary
  3. Joe - Marry
  4. null null

Question 10

Given: What is the result?

  1. [A, B, C] followed by an exception thrown on line 11.
  2. [A, B, C] [A, B]
  3. [A, B, C] [A, B, C]
  4. On line 9, an exception is thrown at run time.