Sharing a random object between multiple instances of a class

A

AtomicReaction

Hey all,

Noob question, but I was wondering how I would go about sharing a Random
object between multiple instances of a class. For instance, I want to
generate a list of this class' objects, but I only want one Random object to
be used between the lot of them. I also need the Random to be contained
within the class.

Any ideas?
 
M

mick

AtomicReaction said:
Hey all,

Noob question, but I was wondering how I would go about sharing a Random
object between multiple instances of a class. For instance, I want to
generate a list of this class' objects, but I only want one Random object
to be used between the lot of them. I also need the Random to be contained
within the class.

Any ideas?

Make it static within the class?

mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top