println vs print
At what point do we use: System.out.print instead of System.out.println ?
println() is used to print in the next line while print () is for printing in the same line. e.g. : 1. System.out.println("hello") System.out.println("world") output : hello world 2. System.out.print("hello") System.out.print("world") output : hello world
print vs println print : in current line println : in new line is work like "\n"
they are both the same right but for me print is used to get user input while println is for the output