Hey JGO, I’m trying to figure out how to get the class’s name that is extending my abstract StringPacket
class.
I know how to get a class’s name:
String className = getClass().getName().replace(getClass().getPackage().getName()+".", "");
How would I inside my abstract class’s constructor obtain the class’s name that is extending the StringPacket
class?
Here is my pseudo StringPacket
class:
public class StringPacket {
private String packetName;
public StringPacket() {
// How would I obtain the name of class extending this?
packetName = ???;
}
}
Thanks for any feedback/help JGO.