Advertisement
Vladkoheca

main.java

Jan 31st, 2025
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | Source Code | 0 0
  1. public class Main {
  2.     public static void main(String[] args) {
  3.         WeatherStation weatherStation = new WeatherStation("Vlado`s station", "Radnevo", 10);
  4.         Meteorologist meteorologist = new Meteorologist("Vlado", 20, "Programming");
  5.  
  6.         System.out.println(weatherStation);
  7.         weatherStation.setStationName("Ilko`s station");
  8.         weatherStation.setLocation("Velingrad");
  9.         weatherStation.setTemperature(0);
  10.         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());
  11.  
  12.         meteorologist.displayInfo();
  13.         meteorologist.setName("Ilko");
  14.         meteorologist.setYearsOfExp(10);
  15.         meteorologist.setSpeciality("Taster");
  16.         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());
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement