In the case of EJB 1.0, the ejbCreate() method returns void for CMP ; this method returns the bean's primary key in BMP. In EJB 1.1 the ejbCreate() method always returns the primary key type; with CMP, this method returns the null value. EJB's by Monson-Haefel, 2nd ED. O'Reilly, page 89. This is annoying one home brewed tests. When I see it on tests for employment decisions, I want to SCREAM.
This question is poorly-worded because it doesn't specify if it is asking what type the method declares to return or what the method actually returns. For CMP beans in 1.1 the ejbCreate method declares that it returns the Primary Key Class but the bean developer should explicitly return null in the method's implementation. Regardless the return value of a CMP bean's ejbCreate method is ignored by the Container. Since this question is ambiguous I would have to choose the most appropriate answer. This would be d) PrimaryKey. I choose this because a) NULL does not exist in Java. There is a null but not a NULL. Again let me restate that this is a poorly worded question and I whole-heartedly agree with Robin, most of the mock exams found on the Net are bogus. In fact, I haven't found a single one that is representative of what is actually tested on the exam. I haven't looked at Ian's mocks yet though. [ April 12, 2002: Message edited by: Chris Mathews ]