Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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.
 
I brought this back from the farm where they grow the tiny ads:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic