+ 4
Why I Use printf keyword in Java Programming???
When I want to see array index then I use System.out.printf(); Because we are always use System.out.println();
1 Antwort
+ 5
I guess
printf is not a keyword
It's a function (method)
It's used in java so that we get C like printf and also because you can use format specifier for precision etc
Like System.out.printf("Formatted with precison: PI = %.2f\n", Math.PI);
https://www.google.com/amp/s/www.geeksforgeeks.org/formatted-output-in-java/amp/