Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- WeatherStation weatherStation = new WeatherStation("Vlado`s station", "Radnevo", 10);
- Meteorologist meteorologist = new Meteorologist("Vlado", 20, "Programming");
- System.out.println(weatherStation);
- weatherStation.setStationName("Ilko`s station");
- weatherStation.setLocation("Velingrad");
- weatherStation.setTemperature(0);
- System.out.println("The new name of the station is " + weatherStation.getStationName() + "\nThe new station`s location is " + weatherStation.getLocation() + "\nThe new temperature of the location is " + weatherStation.getTemperature());
- meteorologist.displayInfo();
- meteorologist.setName("Ilko");
- meteorologist.setYearsOfExp(10);
- meteorologist.setSpeciality("Taster");
- System.out.println("The new name of the meteorologist is " + meteorologist.getName() + "\nThe new years of experience of the meteorologist are " + meteorologist.getYearsOfExp() + "\nThe new speciality of the meteorologist is " + meteorologist.getSpeciality());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement