Java Array Efficiency
I am not 100% sure of the mechanism in action so I decided to post here for further clarifications. I am doing a project that should handle large amounts of data in Java (it has to be Java). I would like it to be as efficient as possible. By efficient I mean that memory and speed calculations should come in first and readability should come in second. Now I have two ways to store my data: create one array of MyObject 1) MyObject[][] V = new MyObject[m][n] Or create two arrays of int: 2) int[][] V = new int[m][n] 3) int[][] P = new int[m][n] Clearly MyObject contains at least two fields and