0
java dummy
what is the significance of using .toString here instead of jTF1.setText(“”+amt)
1 Antwort
+ 1
""+amt
This forces Java to perform an implicit type conversion on the amount, if it is a numeric value (eg int or float)
This has some performance overhead due to the JVM doing some additional function calls in the background.
Integer.toString(amt)
Would be explicit conversion, and besides of being more efficient, it gives the developer total control and visibility over the data type of the operands.
The difference may be subtle and insignificant though, if you are only interested in the end result...