Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package myworld;
- /**
- *
- * @author fmi
- */
- public class Athlete extends Person {
- private String sport;
- public String getSport() {
- return sport;
- }
- public void setSport(String sport) {
- this.sport = sport;
- }
- public Athlete(String sport, String name, int age) {
- super(name, age);
- this.sport = sport;
- }
- @Override
- public void introduceYorSelf() {
- super.introduceYorSelf(); //To change body of generated methods, choose Tools | Templates.
- System.out.println(" I am an Athlete. My sport is " + sport);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement