I'm trying to wrap the following so it shows up easily on the prompt screen. How can I wrap it up?

System.out.println("Anwser the following trivia questions with a true/false input. Since I am"
            "a horrible programmer, you will have to enter 1 for True and 2 for False. If you still do not"
            "understand, here is a table-thingy to clarify.");

Recommended Answers

All 4 Replies

Uhm, add a couple of newlines?

System.getProperty("line.separator");

Or use two or three calls to println rather than just one?

Uhm, add a couple of newlines?

System.getProperty("line.separator");

I've never seen that command before. I'm just learning java, do you mind if you use it in an example?

Ok, I got the text to wrap, thank you for that, but I'm getting this stupid error when i try to compile, on these two lines.

OOPS! NEVERMIND!

I used printf() and it solved my problem

As masijade said, a newline is almost always "\n" so you'd just add "\n" into the String. Or you can say System.out.println() more than once since it automatically adds a newline at the end of your String.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.