Advertisement
Guest User

Untitled

a guest
Jun 10th, 2019
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package Advanced.DefiningClasses.PokemonTrainer;
  2.  
  3. public class Pokemon {
  4.     private String name;
  5.     private String element;
  6.     private int health;
  7.  
  8.     public Pokemon(String name, String element, int health) {
  9.         this.name = name;
  10.         this.element = element;
  11.         this.health = health;
  12.     }
  13.  
  14.  
  15.     public String getElement() {
  16.         return element;
  17.     }
  18.  
  19.     public void lowerHealth() {
  20.         this.health -= 10;
  21.     }
  22.  
  23.     public int getHealth() {
  24.         return health;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement