How can we create more than one instance of a class from single Java class file?

I have a requirement which says I have to create only once class file of one Java Swing application and reuse them to create multiple instance of same application.

One way comes to my mind is store this class file and create instances from that files whenever required.

but is it correct way? Is there any other efficient way to create instance of applications using class created only once and stored somewhere?

Also there is additional desing constraint that says that you should use parts of class files in creating more than one application.

Answers


I have to create only once class file of one Java Swing application

compile the swing application's java source files into class files (this needs to be done just once)

and reuse them to create multiple instance of same application.

run the same class files in different virtual machines instances (sequentially, or simultaneously)

.. or have I got you completely wrong? :)


Need Your Help

Easily insert data into any position of a stream without overwriting?

c# memorystream

What's the easiest way to do this with a normal memorystream? Aside from creating 2 streams.

Writing the buffer to a text file

c++ c file-io buffer

I have a device connected to one of my ports, where I get data. I wrote an interface for it using C++. I can read the data fine, and print it to my screen.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.