using variables from other classes in arrays :/
So i already have this array in a TransmitterTest class:
Code :
network = new Transmitter[networkSize] ;
Transmitter is another class, with x y and radius variables.
There's a few methods in it like getX, getY and getRadius that just return their values.
The TransmitterTest class creates random values for the x and y variables, and there's a set value for radius, then they added to the network array as a Transmitter :
Code :
network[i] = new Transmitter(x, y, radius) ;
that all works so far.
but i dont know how to use these values later on though in another method :/
assumed would be something like
Code :
network[i].Transmitter().x
for value of x of Transmitter in i position of array, but cant get it to work.
Any help
Re: using variables from other classes in arrays :/
Through the array, you would directly access the values of the object, in this case I suspect it would be something like:
But that's a guess without full code