Java question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Java question

What is the deference between “System.out.print” and “System.out.printIn”? Is there something to do with a blank space between the printed words? If not then I have one more following question : how to put a blank space? :) I will be very grateful for a good and clear explanation!

9th Feb 2018, 2:32 AM
Novi Chok
Novi Chok - avatar
3 Answers
+ 12
System.out.print ("abc\n); equals to System.out.println("abc"); /* for spaces , u can give that by spacebar ... no error will come , example : System.out.print("hello world"); else U can write System.out.println("hello\tworld"); //just like Hrishikesh said 😃 , i do the same */ //☺
9th Feb 2018, 3:01 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 5
System.out.print will display the content only. System.out.println will display the content and will move to the next line . You can just use spacecbar to put blank space or \t is a escape sequence used to put a tab space . All the best 👍
9th Feb 2018, 2:40 AM
Hrishikesh Kulkarni
Hrishikesh Kulkarni - avatar
+ 2
Hrishikesh Kulkarni, Gaurav Agrawal, thank you for your answers!👍👍👍
9th Feb 2018, 4:41 AM
Novi Chok
Novi Chok - avatar