The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I need a graphic animation for this codeÂ
public class Airport {
  // Declaring static variables
  private static int countAirports = 0;
  // Declaring insatnce variables
  private String code;
  private int no_of_gates;
  // Zero argumented constructor
  public Airport() {
      super();
      countAirports++;
  }
  // parameterized constructor
  public Airport(String code, int no_of_gates) {
      super();
      this.code = code;
      this.no_of_gates = no_of_gates;
      countAirports++;
  }
  // This static method will return the no of airports value
  static int getCountAirports() {
      return Airport.countAirports;
  }
  // This method is used to compare two objects
  @Override
  public boolean equals(Object obj) {
      if (this == obj)
          return true;
      if (obj == null)
          return false;
      if (getClass() != obj.getClass())
          return false;
      Airport other = (Airport) obj;
      if (code == null) {
          if (other.code != null)
              return false;
      } else if (!code.equals(other.code))
          return false;
      if (no_of_gates != other.no_of_gates)
          return false;
      return true;
  }
  // toString method is used to display the contents of an object inside it
  @Override
  public String toString() {
      return "Airport code:" + code + "; Number of gates: " + no_of_gates;
  }
}
-----------