The Artima Developer Community
Sponsored Link

Java Answers Forum
Simple println command question

1 reply on 1 page. Most recent reply: Jan 27, 2003 9:34 PM by Tj

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Mike B

Posts: 1
Nickname: usedsub
Registered: Jan, 2003

Simple println command question Posted: Jan 27, 2003 8:36 PM
Reply to this message Reply
Advertisement
Hey all, this is probably a basic process, but I'm stuck on something in beginning java. Here's what I'm given:

I meant what I said
and I said what I meant
An elephant's faithful
one hundred percent

Pretty basic at first. I just have to use named constants for each of those lines, and print them out on the screen, with each quotation on it's own line. However, the instructions say that each line of the quotation should be sent to the output stream in the same statement, meaning I can only use one System.out.println command for the entire quote. How do I do that all in just one println command? Anyone here happen to know?


Tj

Posts: 7
Nickname: tj
Registered: Jan, 2003

Re: Simple println command question Posted: Jan 27, 2003 9:34 PM
Reply to this message Reply
> However, the
> instructions say that each line of the quotation should be
> sent to the output stream in the same statement, meaning I
> can only use one System.out.println command for the entire
> quote. How do I do that all in just one println command?
> Anyone here happen to know?

There's this convention of using a symbol to represent the normally invisible newline character. It is represented as "\n". Characters preceded by backslashes (called "escape codes") occasionally mean things.

Flat View: This topic has 1 reply on 1 page
Topic: Session handlers Previous Topic   Next Topic Topic: Need help with dates

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use