I am relatively new to Java and over the years I had to solve all sorts of programming problems where the number of data that needs to be collected is really unknown to the programmer.
Is it a good convention to use Lists to collect strings or integer values when the programmer has no way of knowing the amount of variables that needs to be collected? Or is there a better way to handle this using dynamic arrays in Java?