Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WeatherStation {
- private String stationName;
- private String location;
- private int temperature;
- public WeatherStation(String stationName, String location, int temperature) {
- this.stationName = stationName;
- this.location = location;
- this.temperature = temperature;
- }
- public String toString() {
- return "The object`s name is " + stationName + "\nThe object`s location is " + location + "\nThe object`s temperature is " + temperature;
- }
- public String getStationName() {
- return stationName;
- }
- public String getLocation() {
- return location;
- }
- public int getTemperature() {
- return temperature;
- }
- public void setStationName(String stationName) {
- this.stationName = stationName;
- }
- public void setLocation(String location) {
- this.location = location;
- }
- public void setTemperature(int temperature) {
- this.temperature = temperature;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement