I am relatively new to Java, and over the years I have had to solve all sorts of programming problems, where the amount of data that needs to be collected is really unknown to the programmer.
Is it good to use lists to collect strings or integer values when the programmer is not able to find out the number of variables that need to be collected? Or is there a better way to handle this using dynamic arrays in Java?
If in doubt, using a list is probably the best choice, even if you know the length.
, , , , .
BTW: Java , dynamic arrays.
dynamic arrays
.
- , ArrayList - . OO mambo-jumbo, .
- , "". , .
"" ! ArrayList, LinkedList, Vector ..
, .
( , ) . , API , , , , /, , .
, java.util.Collections , - (, int, float ..), ( ). , . Apache (, , ) , .
- , , , . , ? , , .
Java , List - (, ArrayList, LinkedList, Stack, Vector) .
, ArrayList .
, , .