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
Can a class be private in java?
How does enum work in java?
What is the difference between delete and delete[]
Can you use this() and super() both in a constructor?
what is server side caching?
What is the multi-catch block in java?
What is a boolean used for?
What does indexof mean?
How does linkedhashmap work in java?
Can I override protected method in java?
Is array dynamic in java?
Describe 2 different ways to concatenate two strings.
Can you instantiate the math class in Java?
What is the final keyword?
How do I write a self declaration?