• 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!