To put one Flight object in the first element of an array, flights[], you'd do something like:
flights[0] = new Flight(); // using the appropriate Flight() constructor
How could you build a...
Type: Posts; User: GregBrannon
To put one Flight object in the first element of an array, flights[], you'd do something like:
flights[0] = new Flight(); // using the appropriate Flight() constructor
How could you build a...
Yes, a loop.
The flights array, declared as:
Flight[] flights;
holds Flight objects, not Strings or ints. Isn't that what you needed? An array of Flight objects?
Okay, let's go. I looked through your code see that you've started createFlights() by writing the method signature. Have gone any further than that? If so, post updated code. If not, think about...
You're essentially correct, but you've mixed 'constructor' and 'constructor parameters' together. The constructor is used to create an instance of, or an object from, the class, and the parameters,...
Again, you ask several questions when I asked you to focus on one, specifically about constructor parameters. You didn't mention constructor parameters. Slow down, focus, and ask specific...
I was updating while you were typing. Review my post and answer my question.
Please don't post duplicate posts. I see you've improved this one, so I'm going to leave it and close the other.
Now, can you describe what you mean by "kinda get stuck when it comes to passing...