I have a Java program that is run in Command Line, that contains a set of classes that I have written which all contain common code elements.
Lets assume the structure is the following:
package.AbstractParent (contains: static void main)
package.ClassA (extends: AbstractParent)
package.ClassB (extends: AbstractParent)
When I do the following: java package.ClassA
, the static void main
within the AbstractParent
is called.
Without putting a static void main
in ClassA
and ClassB
, is there a way that I can determine which was called within AbstractParent
?
For example, when I run java package.ClassA
, AbstractParent
will determine ClassA
. When I run java package.ClassB
, AbstractParent
will determine ClassB
.