java - evaluating variable int/string -
int x = 20; Double d = 3.1416; String s = "h"; These are my variables and I have to evaluate the next rows.
d / x + ""; is evaluating the double variable type (0.15708), is that correct?
If you do not have that pesky "" ! Finally add "" to something like this in a string it can actually be an easy shortcut - String.valueOf Instead of using something like () , you can do that 4/2 + "" , which makes it in a string. Repeat,
d / x will be a double , because you are adding a floating point < P> but a double + "" = string . I hope that helps. Good luck :)
Comments
Post a Comment