Executing a Java program will only execute the main
method.
If you need user interactive functionality in your program, then this needs to be accounted for in your main
method. Consider looking into the Scanner
class which allows users to interact with programs by providing inputs.
You can also pass a String[]
array called args
to the main
method which you can parse, but this interactivity only happens once at the start of runtime