At this point, your new program is complete, and works fine, but if you run it long enough, it will fill up your computer's memory with useless class objects. To see why, note that, once one fileone that contains, say, three carshas been analyzed, the memory involved in the analysis looks as follows:
0 1 2 <-- train | | | array v v v index ------------------- ------------------- ------------------- ----*-------------------*-------------------*-------------------*--- | First pointer | Second pointer | Third pointer | ---*-------------------*-------------------*-------------------*---- | | | v v v *-----------------* *-----------------* *-----------------* | First allocated | | Second allocated| | Third allocated | | chunk of memory | | chunk of memory | | chunk of memory | *-----------------* *-----------------* *-----------------*