int x = 100;
Stuff.doStuff(x);
The method doStuff(String) in the type Stuff is not applicable for the arguments (int)
int x = 100;
Stuff.doStuff(x.toString());
Cannot invoke toString() on the primitive type int
int x = 100;
Stuff.doStuff((String)x);
Cannot cast from int to String
int x = 100;
Stuff.doStuff(new Integer(x).toString()); // OMGWTFGRRRBBQ!!!
BUILD SUCCESSFUL
What u doing java 4 these days??
Got to love those primitive types….
Or Integer.toString(x)
But still, why are you using Java??
There’s an easier way:
Stuff.doStuff(“” + x);