What do you mean read a command-line arg?
Notice the signature of the main method is: void main(String[] args)
args is an array of the command-line arguments. If you're coming from a C background, args in Java does *not* begin with the classname. It begins with the first argument after the classname.
If you're asking how to intelligently handle many command-line arguments, then that's a different story. I think Java leans toward [system] Properties instead of command-line args.
Regular expressions may be a little more advanced than you're expecting at this point, but it is such a fundamental and useful tool in CS that I urge you to consider using it for validate the input line. Manually tokenizing is fine, but matching against a regexp is superior.