Sharing a random object between multiple instances of a class

  • Thread starter Thread starter AtomicReaction
  • Start date Start date
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?
 
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
 
Back
Top