Is there a way in Java to call methods from the console?

I know that it is possible to use the args array, for example `args[0]`, to get the name of an input file, but I do not know if Java allows method calls from the console.