Difference between print and printIn | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Difference between print and printIn

4th Jan 2019, 6:28 AM
Syed Danish Hasan
Syed Danish Hasan - avatar
6 Answers
+ 12
● U can say : System.out.println("ABC"); works as : System.out.print("ABC\n"); ● U can avoid using { } if there is only statement to execute in if() block. ● U can make use of search bar to search for previously asked posts on this 👍
4th Jan 2019, 7:42 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 2
"print" prints in same line while "println" after printing moves the cursor to next line. for example Serial.print("A"); Serial.print("B"); /*outputs AB*/ Serial.println("A"); Serial.print("B"); Serial.print("C"); /*outputs A BC*/
4th Jan 2019, 6:57 AM
Mayank Dhillon
Mayank Dhillon - avatar
+ 1
it's working for me. So I can't tell what the problem is. public class Program { public static void main ( String [] args) { System.out.print("A"); System.out.println("B"); System.out.print("C"); } } /*outputs AB C */
4th Jan 2019, 7:15 AM
Mayank Dhillon
Mayank Dhillon - avatar
+ 1
Yes yes, thnk you so so so mch
4th Jan 2019, 7:29 AM
Syed Danish Hasan
Syed Danish Hasan - avatar
0
Could you please check my codes, when i am using printIn it gives error.
4th Jan 2019, 7:10 AM
Syed Danish Hasan
Syed Danish Hasan - avatar