I have a question wherein a text file I have below values
Car,Car1,100,10,5,500
bike,bike2,10,1,1,100
Each vehicle is having its own class which extends parent class Vehicle.Is there a way through which I can compare the first value from the file and check for a class with the same name and then pass the values to its constructor.
currently, I am reading a text file, splitting values by "," and storing it in an array.And then I want to compare the first value at the array in this case 'Car' to available classes, if it matches to the car class it would pass values to its constructor or else if its bike it would pass values to bike class.