Dear all, I am writing a java program that read user input by the mean of arguments, e.g. java ProgramName arg arg.... However, the input parameter may contain space, e.g. java ProgramName eat apple eat orange eat banana, that the program should read it as three parameters "eat apple", "eat orange" and "eat banana". Unfortunately, Java read it as six parameters instead as the space characters. How can I read the parameters correctly as I intended. Regards, Joe
posted 13 years ago
Have the user input the parameters using quotes. java ProgramName "eat apple" "eat orange" "eat banana"