Tuesday, September 20, 2011

Challenge 016’s Solution

When the code is placed into BlueJ™, the following comes out in the Terminal window:
 
\* This is not
a comment *\
 
This is because of what the various symbols in the statement mean. When written between quotation marks in a String[] statement, the symbol “\\” outputs a “\” in the printed string, and “\n” causes the comment to continue on the next line, similar to what the “¶” symbol represents in modern English Writing. The rest of the phrase is printed because it too is between quotation marks.
 
−Phoenix

3 comments:

  1. Good job, Phoenix, one follow-up question:

    There's a technical term that describes \\ and \n, what are they called in the Java programming language?

    ReplyDelete
  2. The technical terms for the “\\” and “\n” characters are “escape sequences”. In specific, “\\” means “backslash”, and “\n” means “newline”.

    −Phoenix

    ReplyDelete
  3. Awesome. 15 XPs awarded for this completion.

    ReplyDelete