79191349

Date: 2024-11-15 06:58:21
Score: 1.5
Natty:
Report link

Indeed as everyone said, it is just an error in the method of execution. When you run the code in the bluej debugger (The return dialogue box), the string is treated as a single word, i.e "1st Line\ntext 2nd". When you use System.out.println() however, the string will be printed as 1st Line text 2nd because it is the System.out.println() function that recognizes the escape sequence as is and not as a part of the string.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Kailash H