I'm thinking about making an object that consists of a large grid, stored in a two dimensional array, and functions that work on that grid.
If I want to iterate through the elements in this array outside of the object, the most readable and privacy-respectful way to access each grid element would be to use a function like grid.getElement(x,y), which simply returns array[x][y].
When the program is compiled into bytecode, is this any less efficient than directly accessing the array by means of grid.array[x][y]?