• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create methods

 
Prashanth reddy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
Can we have overloaded create() methods like
create(String s) and create(int i). I think this is possible. But in one mocke exams( ) they are saying we can have only one create(any argument) methods. All other methods should be like createXXXX(). can somebody please clarify this for me.
Thanks,
Prashanth.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashanth,
You can have overloaded create methods. In fact, amazingly, the EJB 2.1 doesn't even container the word "overload", so there is no explicit restriction. Nifty, huh?
 
Victor Larr
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateless session should have only one no argument create() method
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am assuming that Prashanth is referring only to stateful session beans since, as Victor says, stateless session beans can have only one create() method and no with argument at that.
No argument there Ha!
From HFEJB page 232: "Stateful beans must have one or more create() methods and are NOT required to have a no-arg create(). The create() methods must start with the string "create" and can be overloaded". (Emphasis mine.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic