This is the simplest way i found on my experiments in type casting int
to String
in Java
//initialize a integer type variable
int integerVariable = 4;
//initialize a String type variable
String stringVariable;
//Type Cast int to String
stringVariable=integerVariable="";
is there a simple way than that your comments are really appreciate.
first of all, this is not called casting. Instead it's called converting.
ReplyDeleteSecond of all the code is erroneous, cuz you can't assign a String value what so ever to a int type variable.
The easiest way is, juz assign the int value to String
hmm i tried, but couldn't. anyway thanx for the comment here.
ReplyDelete