The Artima Developer Community
Sponsored Link

Java Answers Forum
how can we convert a numerical to a string??

3 replies on 1 page. Most recent reply: Aug 19, 2002 8:13 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
senthil

Posts: 23
Nickname: rickk84
Registered: Aug, 2002

how can we convert a numerical to a string?? Posted: Aug 18, 2002 8:41 AM
Reply to this message Reply
Advertisement
how can we convert a numerical to a string??


Anand B N

Posts: 4
Nickname: anandbn
Registered: Aug, 2002

Re: how can we convert a numerical to a string?? Posted: Aug 19, 2002 1:41 AM
Reply to this message Reply
Try Integer.parseInt or Long.parseLong...

Javed

Posts: 15
Nickname: javedm
Registered: Aug, 2002

Re: how can we convert a numerical to a string?? Posted: Aug 19, 2002 1:42 AM
Reply to this message Reply
To my knowledge the best way is to concat it to a string.

int i = 5;

String s = i+"";

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: how can we convert a numerical to a string?? Posted: Aug 19, 2002 8:13 AM
Reply to this message Reply
The String class has a static valueOf method which takes all the kinds of arguments you would normally need.

String.valueOf(number);

Flat View: This topic has 3 replies on 1 page
Topic: Help with GUI Previous Topic   Next Topic Topic: portal framework, etc

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use