Cleaner way of creating multiple objects from base class
<p>Let's say I have a class, called BaseClass, that looks something like this</p>

<pre><code>class BaseClass{
    String var1;
    int var2;

    public void methodToBeOverridden(){}
}
</code></pre>

<p>and I need to create a significant number of classes that inherit this class. They will all override <code>methodToBeOverridden()</code>, but will all be instantiated in a static context. Since they all need to be static, they cannot be put in a single .class file to my understanding. Is there any cleaner way to do this than creating a separate .class file for each instance? I really doubt there is, but I thought I'd ask here before I got started on it just in case.</p>