I am really new to java and before this I have coded in Matlab. Now, I need to make a matrix (so 2d array in java) which stores the values for a set of actions lets say a = 1,...A
for every time period t = 1,2...T
. Hence, at the end I need a 2D array of where every row represents time t and every column represents an action.
I have been reading bunch of stuff on staclflow and my limited understanding tells me that may be what I need is linkedlist.
However, I am not sure that is the right way to go. So, I have two questions:
- What is the most efficient way to make a 2d array in JAVA?
- If you could please point me towards some reading material that can teach me how to add, remove, get and iterate over the elements of the method suggested by you.
I will appreciate any help.
Many thanks..!!!!