NadezhdaGeorgieva

Rabbit

Feb 18th, 2021
859
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package rabbits;
  2.  
  3. public class Rabbit {
  4.     private String name;
  5.     private String species;
  6.     private boolean available;
  7.  
  8.     public Rabbit(String name, String species) {
  9.         this.name = name;
  10.         this.species = species;
  11.         this.available = true;
  12.     }
  13.  
  14.     public String getName() {
  15.         return name;
  16.     }
  17.  
  18.     public String getSpecies() {
  19.         return species;
  20.     }
  21.  
  22.     public boolean isAvailable(){
  23.         return available;
  24.     }
  25.  
  26.     public void setAvailable(boolean available) {
  27.         this.available = available;
  28.     }
  29.  
  30.     @Override
  31.     public String toString() {
  32.         return String.format("Rabbit (%s): %s", this.species, this.name);
  33.     }
  34. }
  35.  
RAW Paste Data