I just figured out that when I do this in Java:
for(int x = 0; x < 3; x++)
{
String bla = "bla";
bla += x.toString();
}
It (Netbeans in this case) will tell me I can not dereference my x integer in such a manner (as I would in C#).
Why is that?
Primitive types are not objects in Java, so you need to use other methods to do that, in this case:
Integer.toString(x);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With