Skip to main content

Beginner programming question

2 replies [Last post]
Joined: 2007-10-18

How can I convert a random int into a string?

For example,

Random value = new Random();

int x = value.nextInt();

// How would I go about converting the value of variable x from a random integer into a String? Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-11-17

1. This is a java desktop forum. If you're new to Java, post your questions at [1]
2. Use Integer.toString(int) static method
3. Use "" + myInteger


Joined: 2007-10-18

I'm sorry. I thought I was in the right forum. Thanks for the help though and the link.