control memory usage in game project

The game:

In the game a character can have a certain amount of cents. There can be different characters in the game who have different amounts of cents. One cent has a weight of 50 g. I already designed a Weight class to represent a weight. All cents are identical and they do not 'know' by who the are owned (unidirectional association)

The problem:

The total memory needed to handle cents must by constant in every game that is played (i.e. independent of the amount of cents that circulate during the game)

Some people said something about using a static inner class but I didn't quiet understand how that would solve the problem. I also thought of using a int variable 'totalCentAmount' but didn't get their either

Thanks!

[769 byte] By [busyprogra] at [2007-10-2 20:15:07]
# 1
well if you know how many cents you could need at any one point you could creat a cents pool and pull cents from the pool and release them back to the pool.
Norweeda at 2007-7-13 22:57:22 > top of Java-index,Java Essentials,Java Programming...