I'm guessing you get the error on accessing audioSounds
and minTime
, right?
The problem is you can't access instance members
from static methods
. What this means is that, a static method is a method that exists only once and can be used by all other objects (if its access modifier permits it).
Instance members, on the other hand, are created for every instance of the object. So if you create ten instances, how would the runtime know out of all these instances, which audioSounds
list it should access?
Like others said, make your audioSounds
and minTime
static, or you could make your method an instance method, if your design permits it.