SHARE
TWEET

Untitled

a guest Jun 10th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Advanced.DefiningClasses.PokemonTrainer;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. public class Trainer {
  7.     private int numOfBadges;
  8.     private List<Pokemon> pokemons;
  9.  
  10.     public Trainer() {
  11.         this.numOfBadges = 0;
  12.         this.pokemons = new ArrayList<>();
  13.     }
  14.  
  15.     public void addPokemon(Pokemon pokemon) {
  16.         this.pokemons.add(pokemon);
  17.     }
  18.  
  19.     public void setNumOfBadges() {
  20.         this.numOfBadges++;
  21.     }
  22.  
  23.     public List<Pokemon> getPokemons() {
  24.         return pokemons;
  25.     }
  26.  
  27.     public int getNumOfBadges() {
  28.         return numOfBadges;
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top