Friday, January 17, 2025
HomeProgrammingWhat is the difference between print and println in Java?

What is the difference between print and println in Java?

In Java, print and println are used to display output, but they differ in how they handle the cursor’s position:

print displays the output without moving to a new line. Any subsequent output will appear on the same line.

See also  CSS Border

println displays the output and moves to a new line. Any subsequent output will start on the next line.

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x