1z0-819 Practice Test

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

Question 16

Given: and Which two are valid usages of the annotation? (Choose two.)

  1. @Meal(mainCourse=”pizza”) @Meal(dessert=”pudding”) public class Main { }
  2. @Meal(mainCourse=null) public class Main { }
  3. @Meal(starter=”snack”, dessert=”ice cream”) public class Main { }
  4. @Meal(mainCourse=”pizza”) @Meal(mainCourse=”salad”) public class Main { }
  5. @Meal(mainCourse=”pizza”, starter=”snack”, dessert=”pudding”) public class Main { }

Question 17

Given: and the code fragment: Which three code fragments, at line n1, prints SPRING? (Choose three.)

  1. System.out.println(Season.valueOf(“SPRING”).ordinal());
  2. System.out.println(Season.values(1));
  3. System.out.println(Season.SPRING);
  4. System.out.println(Season.valueOf(“SPRING”));
  5. System.out.println(Season.valueOf(‘s’));
  6. System.out.println(sA[0]);
  7. System.out.println(sA[1]);

Question 18

Given: Which two lines of code when inserted in line 1 correctly modifies instance variables? (Choose two.)

  1. cCount = setCCount(c);
  2. setCCount(c) = cCount;
  3. setGCount(g);
  4. tCount = tCount;
  5. aCount = a;

Question 19

Given: and and You want to print the message こんにちは Joe, 宜しくお願いします, Jane. Which code inserted on line 1 will accomplish this?

  1. ResourceBundle msg = ResourceBundle.getBundle(“/proj/msg/messages”, new Locale(“ja”,“JP”)); Object[] names = “Joe”, “Jane”); String message = MessageFormat.format(msg.getString(“message”),names);
  2. ResourceBundle msg = ResourceBundle.getBundle(“msg.messages”, Locale.JAPAN); Object[] names = “Joe”, “Jane”); String message = MessageFormat.format(msg.getString(“message”),names);
  3. Locale.setDefault(Locale.JAPAN); ResourceBundle messages = ResourceBundle.getBundle(“messages”); String message = MessageFormat.format(msg.getString(“message”),“Joe”,“Jane”);
  4. ResourceBundle msg = ResourceBundle.getBundle(“messages”, Locale.JAPAN); String[] names = “Joe”, “Jane”); String message = MessageFormat.format(msg.getString(“message”),names);

Question 20

Given: and the commands: What is the result on execution of these commands?

  1. Test.class - > java.sql -> java.base
  2. On execution, the jdeps command displays an error.
  3. Test.class -> java.base - Test.class - > java.sql
  4. Test.class -> java.base - Test.class - > java.sql - java.sql -> java.base