If you didn't realise, but you probably do, your constructor is only setting flightNumber and location, so that means:
isLanding(landing if you make the change I suggested)=false
scheduledTime=0
Since they are the default values for booleans and ints.
So upto you if you want to set them when you create a new Plane object
Also, in your methods:
public String getFlightNumber(){
return this.FlightNumber;
}
public void setFlightNumber(String f){
this.FlightNumber = f;
}
public String getLocation(){
return this.Location;
}
public void setLocation(String l){
this.Location = l;
}
public static int getTotalPlanes(){
return Plane.TotalPlanes;
}
You keep using this.someField, well with the way you've written it, you don't need to call this.
You can just refer to the field by its name.
However, with your set methods, its more customary for the argument name to have the same name as the field, in which case it is MANDATORY that you use this, so that it knows which variable you are refering to, eg:
public void setFlightNumber(String FlightNumber){
this.FlightNumber = FlightNumber;
}
And same for other set methods.
One more thing... best to keep your variables lowerCamelCase, that means first letter is lower case, and so on, and Classes as UpperCamelCase, hope that helps.
Last edited by cms271828; Oct 10th, 2006 at 12:03 am.