nerdexam
Broadcom-VMware

2V0-72.22 · Question #71

Refer to the exhibit. How can a Spring Bean be created from this LegacySingleton class?

The correct answer is A. Call LegacySingleton.getInstance() from within a @Bean method and return the instance. See the full explanation below for the reasoning.

Question

Refer to the exhibit. How can a Spring Bean be created from this LegacySingleton class?

Exhibit

2V0-72.22 question #71 exhibit

Options

  • ACall LegacySingleton.getInstance() from within a @Bean method and return the instance.
  • BReturn an instance of LegacySingleton using the new keyword from a @Bean method.
  • CIt is not possible without modifying the LegacySingleton class, the constructor must be public.
  • DModify the LegacySingleton class by adding the @Autowired annotation to the instance variable.

How the community answered

(26 responses)
  • A
    73% (19)
  • B
    4% (1)
  • C
    15% (4)
  • D
    8% (2)

Community Discussion

No community discussion yet for this question.

Full 2V0-72.22 Practice