Hi,
Unless I'm mistaken, default constructors (i.e. no arguments) are automatically provided for a class if you opt not to explicitly provide one yourself.
So, I'm contending with the following:
When I define a default constructor (i.e. public MyClass(){} )
for class MyClass, this all works fine. However, when I don't define this default constructor, a "NoSuchMethodException" is generated. Why would this be, if a default constructor is provided for me??
Thanks for any/all help!
dora
Unless I'm mistaken, default constructors (i.e. no arguments) are automatically provided for a class if you opt not to explicitly provide one yourself.
So, I'm contending with the following:
Code:
class MyClass
{
}
MyClass Fubar = new MyClass();
Constructor ct = ( Fubar.getClass() ).getConstructor(null);
When I define a default constructor (i.e. public MyClass(){} )
for class MyClass, this all works fine. However, when I don't define this default constructor, a "NoSuchMethodException" is generated. Why would this be, if a default constructor is provided for me??
Thanks for any/all help!
dora