P
Prakash Prabhu
Hi,
Is it possible to convert a int value to String using less than 2 objects ?
Two ways of doing it are like :
1. String strValue = Integer.parseInt(value).toString() ;
2. String strValue = "" + value;
In each case two objects are used :
1. The Integer object , the final String object
2. The StringBuffer object , the final String object
Here "value" is an int variable
Are there any other methods ?
Please do excuse if this sounds like a dumb question, but I
would just like to know the best way of converting an int to String.
Thanks,
Prakash
Is it possible to convert a int value to String using less than 2 objects ?
Two ways of doing it are like :
1. String strValue = Integer.parseInt(value).toString() ;
2. String strValue = "" + value;
In each case two objects are used :
1. The Integer object , the final String object
2. The StringBuffer object , the final String object
Here "value" is an int variable
Are there any other methods ?
Please do excuse if this sounds like a dumb question, but I
would just like to know the best way of converting an int to String.
Thanks,
Prakash