Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

VMware Exam 2V0-72.22 Topic 11 Question 67 Discussion

Actual exam question for VMware's 2V0-72.22 exam
Question #: 67
Topic #: 11
[All 2V0-72.22 Questions]

Refer to the exhibit.

How can a Spring Bean be created from this LegacySingleton class?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Mitsue
28 days ago
Hold up, did anyone else notice the exhibit is just a picture of a dog? I'm so distracted now, I forgot the question. What were we talking about again?
upvoted 0 times
Wilda
3 days ago
B) Return an instance of LegacySingleton using the new keyword from a @Bean method.
upvoted 0 times
...
Anthony
10 days ago
A) Call LegacySingleton.getInstance() from within a @Bean method and return the instance.
upvoted 0 times
...
...
Becky
1 months ago
You know, if this was a real-world problem, I'd just rewrite the whole darn thing from scratch. Screw legacy code! Option D is my pick.
upvoted 0 times
...
Joana
1 months ago
C'mon, really? We can't modify the class? That's just lazy. Option B all the way!
upvoted 0 times
Selma
8 days ago
You're right, we can't modify the class. The correct answer is A) Call LegacySingleton.getInstance() from within a @Bean method and return the instance.
upvoted 0 times
...
Margurite
10 days ago
Option B is not the correct way to create a Spring Bean from this LegacySingleton class.
upvoted 0 times
...
...
Myrtie
1 months ago
I think option A is the way to go. Calling getInstance() from a @Bean method seems like the cleanest approach.
upvoted 0 times
Helene
18 days ago
User2: Yes, calling getInstance() from a @Bean method is the cleanest way to create a Spring Bean from LegacySingleton.
upvoted 0 times
...
Annita
23 days ago
User1: I agree, option A is the most appropriate solution here.
upvoted 0 times
...
...
Skye
1 months ago
But wouldn't adding the @Autowired annotation to the instance variable also work? That's option D.
upvoted 0 times
...
Annamaria
2 months ago
I disagree, I believe the answer is C. We need to modify the LegacySingleton class to make the constructor public.
upvoted 0 times
...
Skye
2 months ago
I think the answer is A, because we can call LegacySingleton.getInstance() from a @Bean method.
upvoted 0 times
...

Save Cancel