Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

a question from whizlabs simulator

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is one question for the "special" version of Whizlabs simulator that they are giving for free.
Given the following code for the home interface of a stateful session bean, which of the following statements are true? (BTW, you can't even copy-paste from the damned thing. I have to type it to post it here.)

Correct options are:
C. MyBean is the remote component interface.
E. The code will be valid only if create and createBean methods throw RemoteException.
My problem: What's up with the createBean method? Can you even have such a method in the home interface of a session bean?
 
Bartender
Posts: 3768
39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
1) This method can only be in home interface of STATEFUL Session Bean (stateless session bean can only have create() without arguments). Usually customized "create" methods are used to setup/initialize state of stateFUL session beans.
2) Every method of *REMOTE* home interface has to declare *RemoteException* in method signature. They work over NETWORK.
 
Bob Walker Jr
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for your explanation, Mikalai.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic