Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java bean & public no arg constructor

 
suma sindu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

It's my understanding that a java bean class must provide a public no arg constructor. What if it doesn't ?

I know I can find the answer by trying it out, but i'm in a hurry to write my exam(may be i'm stupid to be trying to attempt the exam without installing the tomcat and trying out some examples, but i'm desparate to get certified ASAP. So I thought of reading HFS book twice and attempting the final mock exam and if don't score well, then installing tomcat and all, but as I got 66%, i thought i'm almost ready for the exam. So i'm trying to get clarifications here.

I tried Anand Chawla's mock exam. In that, a bean was not provided with a public no arg constructor, so i thought it'd give an error, but that was not the case. The answer did not reflect the fact that there was no public no arg constructor.

I know I deserve some scoldings for being lazy to not try this out on my own

Thanks
Suma
[ April 17, 2005: Message edited by: suma sindu ]
 
chowdary Thammineedi
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The compiler supplied default constructor will take care of it. As long as you don't have any other constructor whick takes an argument(s).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic