Book.java 756 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package homework.p09_bookmanager;
  2. /**
  3. * @author WanJl
  4. * @version 1.0
  5. * @title Book
  6. * @description 图书类
  7. * @create 2026/7/22
  8. */
  9. public class Book {
  10. private int id;
  11. private String title;
  12. private double price;
  13. public Book(int id, String title, double price) {
  14. this.id = id;
  15. this.title = title;
  16. this.price = price;
  17. }
  18. public int getId() {
  19. return id;
  20. }
  21. public void setId(int id) {
  22. this.id = id;
  23. }
  24. public String getTitle() {
  25. return title;
  26. }
  27. public void setTitle(String title) {
  28. this.title = title;
  29. }
  30. public double getPrice() {
  31. return price;
  32. }
  33. public void setPrice(double price) {
  34. this.price = price;
  35. }
  36. }