+ 2
What is the difference between print and println?
for printing stuff on screen we use System.out.print(); or System.out.println(); So what's different between print and println?
1 Odpowiedź
+ 7
Well print() prints it without a new line
println prints it with a new line
for eample:
System.out.print("Hi");
System.out.print("Hi");
System.out.print("Hi");
=> output: HiHiHi
System.out.println("Hi");
System.out.println("Hi");
System.out.println("Hi");
=> output:
Hi
Hi
Hi