Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Question

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following method declarations for a session bean class are valid?
Choices:
A. public void ejbCreate(String name) throws CreateException {}
B. public void ejbCreateBigCart() throws CreateException{}
C. public void ejbCreate(String name) {}
D. public static void ejbCreateSmallCart() {}
E. public final PKeyType ejbCreate() {}
F. public PKeyType ejbCreateLargeAccount() {}

Given Answer is A,B
But According me answer should be A,B,C

Please help
Thanks
 
Nguyen Long
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you right, because ejbCreate may throw javax.ejb.CreateExeption and arbitrary application exception defined by bean provider.

Please correct me if I'm wrong .
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because ejbCreate may throw javax.ejb.CreateExeption and arbitrary application exception defined by bean provider.


The CreateException is mandatory, thats why C is not right.
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CreateException is not mandatory in the bean class however it needs to be declared in the home interface of the bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic