|
Until you sign up you can't do much. Yes, it's free.
|
|
|
|
|
|
|
 | / / / Viewing Topic
|  |
|
|
|
|
 LiveWire Humor
|
|
marshmellowman
wewerepromisedjetpacks
Patron
Support Leader
Tech Support Leader
|
Does the \n work like in C++? So you'd have: | Code: | | System.out.println("Hello\nGoodbye"); |
------- and victorious in war shall be made glorious in peace.
|
|
|
|
|
marshmellowman
wewerepromisedjetpacks
Patron
Support Leader
Tech Support Leader
|
The \n actually has to be within the text, no outside the quotes. So yours would be like: | Code: | | System.out.println("Car make and model: Volkswagen Golf \n Expected Annual Mileage: " + mileage "\n Cost of a gallon of gas:" + gallon); | That's how I remember it anyway for C++, it might be different for Java, I'm not too sure.
------- and victorious in war shall be made glorious in peace.
|
|
|
( Majo )
Soothsayer
|
Alright, I'll give that a go and see what happens when I try to compile it, thanks.
------- "Under the hardness of her facade a woman's heart is still beating."
|
2:23 pm on Sep. 12, 2008 | Joined: May 2005 | Days Active: 301 Join to learn more about Majo Pennsylvania, United States | Straight Female | Posts: 6,733 | Points: 10,531
|
|
| |
|
|
ampamp
Professional
|
The \n has to be inside the " marks. I don't see any reason to use them, when printing things out. I would just put them into indiviual println, to make it easier to read later.
------- miimii *_____*
|
|
|
|
|
|
| Looking for something else?
|
|
|
|
|
|
 | / / / Viewing Topic |  |
|