Advertisement
KechevD

Lesson 23 Inheritage_Building_Task1

Apr 18th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public class Building {
  2.  
  3. int height;
  4. double area;
  5. String address;
  6.  
  7.  
  8. public Building(int height, double area, String address) {
  9. super();
  10. this.height = height;
  11. this.area = area;
  12. this.address = address;
  13. }
  14.  
  15. public static void printBuilding(Building b1) {
  16. System.out.println(b1);
  17. }
  18.  
  19. public int getHeight() {
  20. return height;
  21. }
  22.  
  23. public void setHeight(int height) {
  24. this.height = height;
  25. }
  26.  
  27. public double getArea() {
  28. return area;
  29. }
  30.  
  31. public void setArea(double area) {
  32. this.area = area;
  33. }
  34.  
  35. public String getAddress() {
  36. return address;
  37. }
  38.  
  39. public void setAddress(String address) {
  40. this.address = address;
  41. }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement