Sometimes it's better to use dynamic size arrays.

 Java's Arraylist can provide you this feature.

Comments