Evan Irelan wrote:

> If you have no constructor, then by definition you have a public constructor
> with no arguments. Java provides it for you.

That's only true if *no* constructors at all have been defined on the class.

class A {
}

A a = new A();

will compile, but

class A {
  public A(int i) {}
}

A a = new A();

won't.

Thus the requirement.

And as for the initial question, a default parameterless constructor is needed
for newInstance() to work (used in serialization, externalization,
pass-by-value, etc...).

The rule of thumb is: always provide one, even if you can sometimes get away
without doing so.

--
Cedric
http://beust.com/cedric

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to