Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 22
Registered: ‎09-08-2011
My Device: blackberry
My Carrier: office

how to convert integer into sring

hai:

 

  i want convert integer into string....

For Examle:

   int 10;

convert to string....

Contributor
Posts: 41
Registered: ‎08-19-2011
My Device: Bold 9000
My Carrier: Plus

Re: how to convert integer into sring

String k=10+"";

Contributor
Posts: 22
Registered: ‎09-08-2011
My Device: blackberry
My Carrier: office

Re: how to convert integer into sring

its can't wrok

Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: how to convert integer into sring

Try with wrapper classes.
like Integer.toString(10);

Thanks.
Super Contributor
Posts: 278
Registered: ‎11-04-2010
My Device: 4.5 and above
My Carrier: none

Re: how to convert integer into sring

Hi,

  int i = 10;

  String s =  i.toString();

 

check this

 

Thanks & Regards

               pp

Developer
Posts: 16,985
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: how to convert integer into sring

pp, your solution will not work, a primitive int is not an object and does not have toString.
you can use http://www.blackberry.com/developers/docs/7.0.0api/java/lang/Integer.html#toString(int)
or, as already suggested, i+"".
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Super Contributor
Posts: 278
Registered: ‎11-04-2010
My Device: 4.5 and above
My Carrier: none

Re: how to convert integer into sring

Hi,

  Thanks simon. i have taken that integer in vector and used, thats why i was able to get. yes this wont work.Sorry

Thanks & Regards

              pp

Highlighted
New Contributor
Posts: 2
Registered: ‎08-23-2011
My Device: 8310
My Carrier: Kiberno

Re: how to convert integer into sring

String a = String.valueOf(10);