PDA

View Full Version : easy JAVA question


Griff
January 25th, 2006, 12:55 AM
So I just started an intro to computer systems class and we're going to be doing some java programming. Anyway, I just need to write up a simple 'hello world'ish program. I did, but upon inspection of requirement they want

<name>
<date>

but with only using a single print statement.
I.E. I can't just do: System.out.println("<name>");
System.out.println("<date>");
Can't seem to find the syntax anywhere for it. Help? :rolleyes:

otake-tux
January 25th, 2006, 01:19 AM
edit-sorry I misunderstood the question.

omair.majid
January 25th, 2006, 01:22 AM
The '\n' character will insert a 'new line'.

so the code is:

system.out.println("<name> \n <date>");