Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: Methods
|
Posted: Mar 7, 2002 3:53 PM
|
|
Probably who ever recommended this to you had in mind the idea of flexibility. If you write a whole system that has methods all over the place putting output to the screen and asking for input, it is very rigid. At some later point, maybe you will want to migrate it to a graphical (or other) user interface, but since all the I/O is spread throughout the app it will be a big mess.
Also, by centralizing this I/O, you can add features to it. For instance, you may want later have the output logged somewhere in addition to being displayed. Now if you have to go track down every place you used System.out.print() or and System.out.println() and any other method of output, you have a big job. However, if you centralized it in a class or method for displaying results, then voila! One simple place to update!
|
|