Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Meteorologist {
- private String name;
- private int yearsOfExp;
- private String speciality;
- public Meteorologist(String name, int yearsOfExp, String speciality) {
- this.name = name;
- this.yearsOfExp = yearsOfExp;
- this.speciality = speciality;
- }
- public void displayInfo() {
- System.out.println("The name of the meteorologist is: " + name + "\nThe years of experience of the meteorologist are: " + yearsOfExp + "\nThe speciality of the meteorologist is: " + speciality);
- }
- public String getName() {
- return name;
- }
- public int getYearsOfExp() {
- return yearsOfExp;
- }
- public String getSpeciality() {
- return speciality;
- }
- public void setName(String name) {
- this.name = name;
- }
- public void setYearsOfExp(int yearsOfExp) {
- this.yearsOfExp = yearsOfExp;
- }
- public void setSpeciality(String speciality) {
- this.speciality = speciality;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement