Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package spaceStationRecruitment;
- public class Astronaut {
- private String name;
- private int age;
- private String country;
- public Astronaut(String name, int age, String country) {
- this.name = name;
- this.age = age;
- this.country = country;
- }
- public String getName() {
- return name;
- }
- public int getAge() {
- return age;
- }
- public String getCountry() {
- return country;
- }
- @Override
- public String toString() {
- return String.format("Astronaut: %s, %d (%s)",this.getName(),this.getAge(),this.getCountry());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement