To understand how this works you need to understand how public static void Main(String[] **args**)
works.
Looking at: billBeforeTip = Double.parseDouble(arg0.toString());
We see that it attempts to parse a double from the first String
passed in via the command line. If you were to turn your java application into a executable JAR it would run in the command prompt, then your code snippet you've provided would work successfully.
When you go to call the executable in the command prompt you can pass values into the args
variable. Like so:
loc\javaVersion -jar myJar.jar args[0] args[1] etc
After this runs your application would attempt to parse args[0]
and turn it into a double.
Edit: Some IDE's allow you to pass in command line parameters which would allow you to debug your program and see how it would operate based on the passed in values.