-
-
Save nbavafa/c1f7777b732b9daff332 to your computer and use it in GitHub Desktop.
Bus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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