Computer Science Canada

a "System.out.println" question...

Author:  princess [ Mon Feb 09, 2004 7:06 pm ]
Post subject:  a "System.out.println" question...

when i am using System.out.println... in a loop how do i make everything appear on one line??

Author:  Tony [ Mon Feb 09, 2004 7:07 pm ]
Post subject: 

well println is a line Confused you have to use
code:

Systerm.out.print();

instead...

Author:  princess [ Mon Feb 09, 2004 7:09 pm ]
Post subject: 

sooo theres no way i can do it with the \n or \t and the "special formatting commands?

Author:  Tony [ Mon Feb 09, 2004 9:30 pm ]
Post subject: 

\n is the new line character. It creates a new line Laughing what .println does is it sticks \n at the end of your string for you.

Using .print instead should fix that problem Thinking

Author:  Paul [ Mon Feb 09, 2004 11:39 pm ]
Post subject: 

Maybe there's an assignment asking you not to use print but to use println, then you can add all the strings together and make one big println

Author:  Tony [ Mon Feb 09, 2004 11:45 pm ]
Post subject: 

lol Laughing don't you guys just hate those assignments where they tell you something like
Quote:

now class... I know that our IDE comes with a library that allows us a 1 line solution, but instead I'd like you to research the topic and write up a 2 page chunk of code that runs at 1/100 efficiency


Laughing sorry.. but Paul Bian's comment just reminded me of all those times where kids used to spend days on base conversion programs in turing and then someone whould just whip out strint()+intstr() 2 line program that's the entire solution Laughing

Author:  Paul [ Mon Feb 09, 2004 11:47 pm ]
Post subject: 

Ha, that time was a few months ago for me.


: