• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

create methods  RSS feed

 
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.
 
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?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateless session should have only one no argument create() method
 
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.)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!