Guest User

sos

a guest
Mar 6th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1.  
  2. public class Weapons {
  3. private String name;
  4. private int damage = 0;
  5. // Constructors
  6. public Weapons(String newName, int newDamage) {
  7. name = newName;
  8. damage = newDamage;
  9. }
  10. // Getters
  11. public String getName() {
  12. return name;
  13. }
  14. public int getDamage() {
  15. return damage;
  16.  
  17. }
  18. // Setters
  19. public void setName(String name) {
  20. this.name = name;
  21. }
  22. public void setDamage(int damage) {
  23. this.damage = damage;
  24. }
  25.  
  26. public static void printWeapon(Weapons) {
  27. if(name = null) {
  28.  
  29. }
  30. System.out.println("" +getName);
  31. }
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment