By chance I am using reflection to decode some user string entry, which can be in some case a simple integer digit (0-9) and other times it can be a call to another class methods.
While checking the string input userInput
to see if a class with that name exists:
Class<?> c = Class.forName(this.getClass().getName() + "$" + userInput);
and to my surprise when the user enters "1" or "2" Class.forName()
indeed finds a class with that name. This is probably basic Java, so forgive me for asking: what are those classes?
I followed the code with the debugger and checked for other numbers, only 1 and 2 seem to be defined.