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

Oracle Exam 1Z0-900 Topic 2 Question 61 Discussion

Actual exam question for Oracle's 1Z0-900 exam
Question #: 61
Topic #: 2
[All 1Z0-900 Questions]

Given the code sample:

And:

And:

And the next fragment from beans.xml:

And this injection point:

@Inject GenericMessenger messageHandler;

Which type would be injected at run time and referenced by the messageHandler variable?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Anastacia
5 days ago
Haha, this question is like a game of 'guess the bean'. I'm going to go with C and pray for the best. Ambiguous bean references are the bane of every Java developer's existence.
upvoted 0 times
...
Tambra
6 days ago
I bet the answer is D. GenericMessenger. The injection point is using that interface, so it should just return the base interface implementation, right? *scratches head*
upvoted 0 times
...
Lucy
13 days ago
Definitely C. An exception would be thrown. How are we supposed to know which implementation to choose when there are multiple beans of the same type? This is a tricky one!
upvoted 0 times
...
Truman
18 days ago
Hmm, you might be right. I guess it depends on how the beans are configured in the application context.
upvoted 0 times
...
Vannessa
23 days ago
I'm going with B. MsgHandler. The code samples show that MsgHandler implements GenericMessenger, and it's the only one that matches the injection point.
upvoted 0 times
...
Elza
24 days ago
Hmm, I think the answer is C. The beans.xml configuration seems to have multiple beans that implement the GenericMessenger interface, so there would be an ambiguous bean reference exception.
upvoted 0 times
...
Fatima
24 days ago
I disagree, I believe the answer is D) GenericMessenger because that's the type specified in the injection point.
upvoted 0 times
...
Truman
27 days ago
I think the answer is A) SmsHandler because it matches the type of the injected variable.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77