• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Mock Question

 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Seriously? That's what you're going with? I prefer this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic