Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package rabbits;
- public class Rabbit {
- private String name;
- private String species;
- private boolean available;
- public Rabbit(String name, String species) {
- this.name = name;
- this.species = species;
- this.available = true;
- }
- public String getName() {
- return name;
- }
- public String getSpecies() {
- return species;
- }
- public boolean isAvailable(){
- return available;
- }
- public void setAvailable(boolean available) {
- this.available = available;
- }
- @Override
- public String toString() {
- return String.format("Rabbit (%s): %s", this.species, this.name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement