To all java beginers | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

To all java beginers

whats the diffrent between println printif and print

18th Mar 2017, 5:15 PM
Azim Conrad Wawire
Azim Conrad Wawire - avatar
3 ответов
+ 3
println() is used to print on new console line where as print() is used to not to print on new console line i.e. on same line.
18th Mar 2017, 5:18 PM
Vishal Prajapati
+ 3
if by "printif" you mean "printf", it is used to print formatted text in console :D for example: System.out.printf("I %s %d apples", "have", 2); this will print "I have 2 apples" in console. %s means a string goes here and %d means a decimal number goes here. by the way, printf has more formatting options :D
18th Mar 2017, 5:52 PM
Amin Mousavi
Amin Mousavi - avatar
+ 2
15th Apr 2017, 11:57 AM
یاس درسا
یاس درسا - avatar