Write the output of the following statement System out println(“Incredible “+”/ n “ + “world”) ;
Answers
Answered by
3
Given códe :
System out println(“Incredible” + “\n” + “world”);
Output :
Incredible
world
Concept :
\n is the escape sequence in java which is used to insert a newline in the text at this point.
So the word Incredible is printed in a line and the word world is printed in the next line.
Knowledge Bytes :
- What are escape sequences?
Escape sequences are the commands used along with print statement. It controls the cursor on the screen to display information in specific format.
Some escape sequences :
- \t → Horizontal Tab
- \v → Vertical Tab
- \\ → Backslash
- \' → Single quotes
and so on.
For better understanding refer to the attachment.
Attachments:
Similar questions