nerdexam
Oracle

1Z0-860 · Question #2

A developer writes a session bean which uses several configurable constants. The constants are all defined as String types in JNDI. This cannot be changed because existing code is using the same…

The correct answer is C. Load the date string in an instance String type variable by annotation of this instance variable and D. Load the date string in an instance Date type variable by annotation of a setter method that takes a. See the full explanation below for the reasoning.

Question

A developer writes a session bean which uses several configurable constants. The constants are all defined as String types in JNDI. This cannot be changed because existing code is using the same JNDI information. One of the constants is a date, represented in string format. This date constant is used in multiple business methods of this session bean, actually as a Date object. Converting strings to dates is an expensive operation; therefore, the developer wants to do as little converting as possible. Which two scenarios can be used to prevent converting from String to Date in every business method? (Choose two.)

Options

  • ALoad the date string in an instance Date type variable by annotation of the instance variable and let the
  • BLoad the date string in an instance String type variable by annotation of this instance variable and
  • CLoad the date string in an instance String type variable by annotation of this instance variable and
  • DLoad the date string in an instance Date type variable by annotation of a setter method that takes a

How the community answered

(22 responses)
  • A
    9% (2)
  • B
    14% (3)
  • C
    77% (17)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice