Assume that I have defined two arrays in Java. The first array has m cells and the second has n cells. Assume that each cells can have a 0 or 1 value.
In this program every cell of the first array will join one of the cells of the second array, but we do not know which one will be connected to which cell of the second array (This connection is totally logical,e.g. we just know array1[3] is related to array2[7]).
So now I want to define an event handler for each of these relationship, so when one of the cells fluctuate from 1 to 0, its paired cell fluctuate. Actually I want to define event handler in a run-time and in dynamic way, because before it, I do not know which one of the cells in array1 will be pair with which one of cells in array2.
Is there any solution for this?
If you think I can solve this problem without dynamic event handler please let me know about your solution.