Skip to content

Instantly share code, notes, and snippets.

@nbavafa
Created November 18, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbavafa/c1f7777b732b9daff332 to your computer and use it in GitHub Desktop.
Save nbavafa/c1f7777b732b9daff332 to your computer and use it in GitHub Desktop.
Bus
package BusStationPackage;
public class BusStation {
private String Address;
private Bus bus1;
private Bus bus2;
//non-parameterized constructor
public BusStation() {
bus1 = new Bus();
bus2 = new Bus();
}
//getter and setter for Address
public String setAddress() {
Address = setAddress();
}
public String getAddress() {
return Address;
}
//getBus(int busNumber) - if bus number is 1, send the info for bus 1, otherwise send the info for bus 2
public String getBus(int busNumber) {
if (busNumber == 1) {
return setBus();
}
}
//setBus(int busNumber) - if bus number is 1, set the info for bus 1, otherwise set the info for bus 2
public String setBus(int busNumber) {
if (busNumber == 1) {
bus1 = setBus(1);
}
else {
bus2 = setBus(2);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment