+ 3
Need help with printf
i cannot figure out printf what can i do with it and how do i make use of it and how do i best use it? can someone explain it in simply so that my noob self can understand?
9 Réponses
+ 18
Are you familiar with printf() of C? Then it'll be easy for you to understand how the placeholders work.
int num = 4;
char letter = 'A';
double value = 5.8;
System.out.printf("%d %c %.2f", num, letter, value);
// output : 4 A 5.80
+ 18
@very hard .... ... ~\(≧▽≦)/~~\(≧▽≦)/~
Typing "Master" is easier and less time consuming than typing your actual name 😈
+ 8
https://code.sololearn.com/cXX20M0x1PA4/?ref=app
this is some short stuff that I can explain to you about String.format
Don't call me master. I hate it (I'm noob!)
+ 8
@Shamima Yasmin
-_____-
Don't mention about my name
+ 6
Ah.....
I never use printf in java I use String.format() Instead
+ 2
thank you guys alot for the explanation
+ 1
bout to read that
how does String.format work? teach me master 😢
0
It's a regular print function you can use in order to print strings. Try to learn all of those functions because you are going to need them in order to code better. Otherwise it might affect you with errors which spend a lot of precious time. Of course you can always use an app to detect those errors for you. I have heard of one called checkmarx you can try.
Anyway, good luck!
Ben.