diffrence b\w println() and printf()

Answer Posted / mohneesh

printf in Java works exactly as in C.

it automatically formats your string, which is not possible
in println directly.

System.out.printf("%s\n\t%s","Mohneesh","Wadhwani");

Output:
Mohneesh
Wadhwani

where as you can use String Formatter to format String then
pass it to println to print.

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a layout manager and what are different types of layout managers available in java awt?

970


what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread

722


What is entry in java?

812


What does three dots mean in java?

883


How do you remove an element from an arraylist in java?

689


What super () does in java?

691


What is toarray method in java?

789


What does nullpointerexception mean?

869


Describe the term diamond problem.

789


How do you remove all elements from an arraylist in java?

741


Is break statement can be used as labels in java?

719


What is the difference between access specifiers and access modifiers in java?

858


Explain scope or life time of local variables in java?

801


Why static functions are used?

813


What is oop principle in java?

757