+ 1
2D Arraylist
Hello I have a 2D Array my problem is i need an dynamic 2D Array to remove elements inside of the inner Array
15 Réponses
+ 2
Was there a problem using regular array that you decided to use a dynamic array instead?
Why you need to remove elements from the inner array? can you describe what is it that yoi're trying to do? an example may help clarify I hope.
+ 2
I am writing an calendar app with a date and note wich i want to save and load This is all working but i cant remove a date within the inner array
Because of this i need a dynamic 2D Array
Maybe with an 2D ArrayList
But i am not sure how
+ 2
Is it something similar to this-
{{"04/01/20", "Yesterday was Saturday"}, {"05/01/20", "Today is Sunday"}};
Probably if you could just share your code, it would be easy for people to help.
+ 2
You want to remove all days, months and year from index 1?
+ 2
You can use HashMaps in Java, the most simple and straightforward way.
+ 2
BitScrypt would you like an example code?
Considering that you can build on that.
+ 2
Rishi,
It's been a year since the date of the thread, I don't even remember why I asked that at the time.
I saw your code where you used `ArrayList`, as I understand it, it is one of Java dynamic containers. And as I understand regular arrays are static, in that they are not resize-able, and unable to grow or shrink as necessary.
+ 1
You have a 2D array and you need a dynamic 2D array to remove elements inside of the inner array?
Have you wrote it right?
+ 1
Index
0 {{Days}{Months}{Years}}
1 {{1}{5}{2020}}
2 {{3}{12}{2020}}
For example i want to delete date on Index 1 but i can only delete the last element with a normal Array
+ 1
Ipang what you mean by "Was there a problem using regular array that you decided to use a dynamic array instead?"? Because, there are no non-dynamic arrays in Java right?
+ 1
Ipang yeah that's right. Both ArrayList and regular arrays are dynamical allocated(on the heap). Only that, normal array don't have a way to be resized
0
yes
0
Ok i am trying it
thank you for your help
0
Would be nice