Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 6

Given the code fragment:

Which code can be added to register both of these methods to receive BankEvent notifications only if an instance of BankActivityService is already instantiated in the current context?

    Correct Answer: D

    To register methods to receive notifications only if an instance of BankActivityService is already instantiated in the current context, you must use the @Observes annotation with the notifyObserver parameter set to IF_EXISTS before the method parameter declaration. This ensures that the methods are only invoked if the observer instance is already available. Therefore, the correct code is @Observes(notifyObserver=IF_EXISTS) on line 4 and line 7 before the method parameter declaration.

Discussion
ciellaf5Option: D

Correct answer D

orjavaOption: D

correct answer D - before method parameter declaration

gozdeydOption: D

reference in the answer suggest that it is d.