Hello everyone how can I do to initialize
ArrayList<Record<T>> [] values;
with a number of rows and columns? for example, with three rows and four columns?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using an array of generic type (such as
ArrayList<T>) is a way to hell. The following line doesn’t even compile:The compiler issues this error:
The only sensible solution is to create a list of lists:
And now you can access the element at [2][3] (last element of the last row):