This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFEJB Page 368, Q # 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFEJB Page 368, Q # 5" Watch "HFEJB Page 368, Q # 5" New topic

HFEJB Page 368, Q # 5

Alfred Harre
Ranch Hand

Joined: Apr 29, 2004
Posts: 73
Which are legal declartions for bean's ejbCreate() method?

B. public String ejbCreateAccount() throws javax.ejb.CreateException
D. public int ejbCreate()throws javax.ejb.CreateException

Why can not option D be the correct answer? Any ideas? thoughts?
Mike Melton

Joined: Jun 29, 2004
Posts: 13
Is this a question about entity or session beans? Either way, option D does not represent a valid signature. For session beans, ejbCreate() should have void return type. For entity beans, ejbCreate() returns the primary key type, which cannot be a primitive type like int. (Note that getPrimaryKey() returns a java.lang.Object!)

Don't get me started about those stupid light bulbs.
subject: HFEJB Page 368, Q # 5
Similar Threads
Mock Exam HF EJB
HFE p368 #5 question
Coffe Cream on EB - Mistakes/Doubt #2
Entity bean question - HFEJB pag 363, exe: 5!
Valid ejbCreate method?