Joke Collection Website - Blessing messages - What is the meaning and difference between carriage return and line feed in java?
What is the meaning and difference between carriage return and line feed in java?
\r Enter is to move the cursor to the front of a line.
\n Yes, move to the next line.
I'll analyze it for you sentence by sentence.
1 represents the cursor position.
system . out . print(" a ");
Output:
a 1
system . out . print(" \ n ");
Output:
a
1
system . out . print(" b ");
a
b 1
system . out . print(" \ r ");
a
1b
Note that the carriage return here moves the cursor in front of B, so B will be replaced when C is output next time.
system . out . print(" c ");
a
c 1
The following is the same.
Analyze it yourself.
- Related articles
- Mid-Autumn Festival romantic love blessing SMS
- How to write Christmas Eve copy?
- How soon can I receive a text message after changing my card?
- When did WeChat come out?
- The golden rice is nodding and smiling, the pomegranate is drunk with joy and its cheeks are red, the osmanthus is beige and fragrant, the blue sea is as clear as the moon, and the foggy peaks are mis
- What does the SMS center number do?
- A short message inviting brothers to the party
- How to send text messages on iPhone7?
- What happens if a stranger sends a link to a scam message and opens it?
- Valentine's day girlfriend is not around, how to send her a message and ask about the content of the message? ...