Sorry for the noob questions. Passing by reference vs. value is hard!
So I have a class with pretty big data structures-- multidimensional arrays. I need to access these arrays from another class. I could just make the arrays public and do the classic objectWithStructures.structureOne. Or, I could do getters: adding a method like public int[][][] getStructureOne().
Does having a getter make a copy of the multidimensional array? Or does it pass it by reference and you just can't alter the object referenced?
I'm worried about memory and performance. But making the data structures public, while faster if it doesn't cause copies to be made, seems like poor coding practice.
ADDENDUM: So when I return a reference to an object (e.g. an array) using a getter method, can that object be edited by whoever uses the getter method? Or is it somehow "locked" for editing so that only the class it's in can alter that object?