1Z0-895 · Question #76
Which two annotations can be applied at the class, method, and field levels? (Choose two.)
The correct answer is A. @EJB C. @Resource. Target: Class, Method, Field Specifies a dependency or reference to an EJB business or home interface. You annotate a bean's instance variable with the @EJB annotation to specify a dependence on another EJB. C:javax.annotation.Resource Target: Class, Method, Field Specifies a…
Question
Options
- A@EJB
- B@Init
- C@Resource
- D@RolesAllowed
- E@PostActivate
How the community answered
(28 responses)- A79% (22)
- B4% (1)
- D4% (1)
- E14% (4)
Explanation
Target: Class, Method, Field Specifies a dependency or reference to an EJB business or home interface. You annotate a bean's instance variable with the @EJB annotation to specify a dependence on another EJB. C:javax.annotation.Resource Target: Class, Method, Field Specifies a dependence on an external resource, such as a JDBC data source or a JMS destination or connection factory. B:javax.ejb.Init D:javax.annotation.security.RolesAllowed Target: Class, Method Specifies the list of security roles that are allowed to access methods in E:javax.ejb.PostActivate Specifies the lifecycle callback method that signals that the EJB container has just reactivated the EJB 3.0 Metadata Annotations Reference
Topics
Community Discussion
No community discussion yet for this question.