Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Singleton with Reflection

  Asked By: Navin    Date: May 17    Category: Java    Views: 1323

I have a design problem. My main class OrderXML is
extended by several others and these will be aswell
extended by a last layer.
Using Reflection a tried to create instance of the
subclasses and apparently a new instance of the super
class was created too, as most of the object of this
were null again.
How can I proceed for reusing always the same instance
of the super class?
I suppose I need a Singelton, do I? However, how can I
do it? Reflection requiered a public contructor!!
Is there any other way to go over such a problem?