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
Difference between final and effectively final ? Why is effectively final even required ?
Explain the difference between the public, private, final, protected, and default modifiers?
How many ways can an argument be passed to a subroutine and explain them?
What exactly is a .class file?
Is java a digit method?
How do I print a “?
How are observer and observable used in java programming?
difference between byte stream class and character stream class?
What is super constructor?
what is interface in java? Explain
Is 0 an irrational number?
Which class should you use to obtain design information about an object in java programming?
Why vector class is used?
What is the use of arrays tostring () in java?
explain the difference between jdk and jvm?