I want to read a function’s name from the console, and then calling it in that class.
So, instead of checking which function it is using the “IF” statement, I wish it to happen automatically.
Exmp.
_ (CONSOLE)
BuildDatabase (WRITTEN IN CONSOLE)
---> What happens in class : Class.BuildDataBase();
Can it be done?
Another question – how can I run my class’ main from a command line?
Thanks ahead
You can use reflection for that:
Running from console is done via the
javacommand –java ClassName