_MuradPro_

Button

Mar 29th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1.  
  2. public class Button {
  3. int num;
  4. int size;
  5. String color;
  6.  
  7. public Button(int num) {
  8.     this.num = num;
  9.     this.size = 5;
  10.     this.color = "black";
  11. }
  12.  
  13. public Button(int num, int size, String color) {
  14.     this.num = num;
  15.     this.size = size;
  16.     this.color = color;
  17. }
  18.  
  19. public int getSize() {
  20.     return size;
  21. }
  22.  
  23. public void addToSize(int x) {
  24.     this.size += x;
  25. }
  26.  
  27. public boolean isSameSize(Button other) {
  28.     if(this.size == other.getSize())
  29.         return true;
  30.     return false;
  31. }
  32. }
Add Comment
Please, Sign In to add comment