I'm looking for a starting point on this. Can someone point me in the right direction?
I want to allow a user to create a new class object that will just store data.
My class is data and my type is "flight" so:
Data flight1 = new Data("A string", "A string", "A string", an int);
If I wanted to allow a user to create new flights I would have to predefine those with blank data and use set methods to define the flights to the users input.
The problem with this is that I would have to create x amount of blank variables which would make my program bulky and they could only create as many variables as I had predefined.
What I'm looking to achieve is when I prompt if they choose to create a new variable the system will automatically create a new variable with a computer generated name (maybe "flight" and then an incrementer for 1,2,3...).[code=java]
Data flight1 = new Data("A string", "A string", "A string", an int);
If I wanted to allow a user to create new flights I would have to predefine those with blank data and use set methods to define the flights to the users input.
The problem with this is that I would have to create x amount of blank variables which would make my program bulky and they could only create as many variables as I had predefined.
What I'm looking to achieve is when I prompt if they choose to create a new variable the system will automatically create a new variable with a computer generated name (maybe "flight" and then an incrementer for 1,2,3...).