I was given this little bit of code by my teacher for this weeks lab to help out and sadly it helps a bit but just not enough. In the context im in “selectedType” i’m not sure about and that’s not why i’m here. I’m here because I wanna know if someone can explain what “Airplane.Type.Fighter” could be.
Airplane is a class connected to this one. But i’m not sure if Type is another class that should be inside of Airplane or not.
Thoughts?
switch (selectedType)
{
case Airplane.Type.Fighter:
newPlane = new FighterJet(name, position, cboPlaneType.SelectedItem);
break;
case Airplane.Type.Passenger:
int numPassengers = Utilities.getIntegerInputValue(txtNumberPassengers);
newPlane =
new PassengerAirplane(name, position, txtType.Text, txtFlightNumber.Text, numPassengers);
break;
default:
newPlane = new Airplane(name, position);
break;
}
Well, we can only guess here. My guess is that Airplane is a property of the current class and that
Airplane.Typeis an enumeration with values such asFighterJetandPassenger.As sean pointed out in the comments, it’s a good chance that it’s an inner enumeration.