
So when i run this no matter what i type in it results in the first section of the if statement.
You are right. Those very long lines, which make the code difficult to read. That can be sorted out by closing the Strings with quotes " and using the + operator. You can see how it is done now I have changed it.Bryce Wade wrote: . . . WARNING some text is gory! . . .

I said printf.Jesper de Jong wrote:As far as I know %n only works with System.out.printf (and String.format), not with System.out.println.
Bryce Wade wrote:and what is the difference between the two print statements?
Bryce Wade wrote:ok campbell. but do you have any suggestions on how to get the program to the end of the program?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
I think you've already been told more than once: System.exit(int) - however, it's usually not needed in normal use.
Ivan Jozsef Balazs wrote:Well, it is if you want to return a non-zero return code from your program.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Bryce Wade wrote:thanks for the responses
![]()
sorry John but thats leaving the for-loop process.
i am looking for a line of code used to exit the actual program.
OCPJP 6 86%
Campbell Ritchie wrote:There are very few things nowadays which actually use the exit value.
Ivan Jozsef Balazs wrote:Every time I write a Java batch program, that is, one to be run from a script, I make sure the program exits with a useful return code.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
but the idea of running programs from scripts that can actually do something about a return code other than 0 (except to log it) seems a bit old-fashioned
Ivan Jozsef Balazs wrote:With a potent scripting language (like bash), it is no problem to cruft together a script implementing some non-trivial piece of logic...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Ivan Jozsef Balazs wrote:
Winston Gutkowski wrote:
but the idea of running programs from scripts that can actually do something about a return code other than 0 (except to log it) seems a bit old-fashioned
The script can make a decision depending on the return code of the Java program for example whether to continue or not the procedure.
With a potent scripting language (like bash), it is no problem to cruft together a script implementing some non-trivial piece of logic,
and a Java program can be a welcome component.
Jeff Verdegan wrote:
I honestly can't remember the last time I wrote a shell script that cared about anything other than zero vs. non-zero.
