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
What is a layout manager and what are different types of layout managers available in java awt?
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
What is entry in java?
What does three dots mean in java?
How do you remove an element from an arraylist in java?
What super () does in java?
What is toarray method in java?
What does nullpointerexception mean?
Describe the term diamond problem.
How do you remove all elements from an arraylist in java?
Is break statement can be used as labels in java?
What is the difference between access specifiers and access modifiers in java?
Explain scope or life time of local variables in java?
Why static functions are used?
What is oop principle in java?