PDA

View Full Version : instantiating structs


haiderle
03-09-2007, 12:14 PM
Hi there,

I tried to instantiate a struct, which has two argument constructors and the implicit no-argument constructor, which can not be explicitely declared, because this is a struct.

Giving the no-argument object-definition, there is a Fatal-Object-Exception:

Cannot instantiate a class that does not have a public no-argument constructor.

Is there any workaround to instantiate this struct without arguments anyway?

thanks for your help

haiderle

Aleks Seovic
03-09-2007, 05:18 PM
I don't think so, I believe you have to specify necessary arguments using <constructor-arg> elements within your definition.

- Aleks