aspose file tools*
The moose likes Beginning Java and the fly likes Displaying others variables in a String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Displaying others variables in a String" Watch "Displaying others variables in a String" New topic
Author

Displaying others variables in a String

Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
How do you convert a variable to a string? eg if i have

String line;
int n = 0;

how can i make it so that line = "0"?
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140

or

or


Mani
Quaerendo Invenietis
Richard Bradford
Ranch Hand

Joined: Apr 20, 2004
Posts: 48
OR

line = String.valueOf(n);

Which also works with other primatives such as boolean, char etc
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying others variables in a String