I'm doing a finance calculator in Java, and I need to be able to grab transaction info like Name, Amount, and Type. It needs to be dynamically sizable and able to hold the info. Basically I need a mix between an ArrayList and an Array of Objects but I can't really find anything that exists.. By looking at this question Creating an Arraylist of Objects, and the code below:
ArrayList<Matrices> list = new ArrayList<Matrices>();
list.add( new Matrices(1,1,10) );
list.add( new Matrices(1,2,20) );
it looks like I can create a new object each time that holds my data, so for my purposes it would look something like this
ArrayList<Payments> paymentList = new ArrayList<Payments>();
paymentList.add( new Payments(var1, var2, var3) );
Can I input variables into the ArrayList? Of course once I convert them all to strings (or could I keep them as String / Double / String since I'm technically adding an object to the ArrayList rather than a string value?