This can happen because the basic types aren't objects. Things like the toString()
method are part of java.lang.Object, and as such aren't available for the basic types. There are usually workarounds, such as this one:
int i = 8;
String foo = i.toString();
becomes
int i = 8;
String foo = i + "";