Basic programming principles would say… Another class should not directly access data from another class. Your array should be private and you have class functions to modify the contents of the array and get elements from the array… It may take a little more work, but it helps keep bugs at bay. It’s basic defensive programming… In your function you can double check what some other function wants to change it to. If it’s bad data, you don’t allow the change.