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.
println displays the output and moves to a new line. Any subsequent output will start on the next line.