I want to create a two dimensional array dynamically.
I know the number of columns. But the number of rows are being changed dynamically. I tried the array list, but it stores the value in single dimension only. What can I do?
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.
Since the number of columns is a constant, you can just have an
Listofint[].Since it’s backed by a
List, the number of rows can grow and shrink dynamically. Each row is backed by anint[], which is static, but you said that the number of columns is fixed, so this is not a problem.