Advertisement
andersonalmada

Untitled

Jul 6th, 2022
1,296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. package mandacaru3.entities;
  2.  
  3. public class Product {
  4.  
  5.     private int id;
  6.     private String name;
  7.     private double price;
  8.  
  9.     public int getId() {
  10.         return id;
  11.     }
  12.  
  13.     public void setId(int id) {
  14.         this.id = id;
  15.     }
  16.  
  17.     public String getName() {
  18.         return name;
  19.     }
  20.  
  21.     public void setName(String name) {
  22.         this.name = name;
  23.     }
  24.  
  25.     public double getPrice() {
  26.         return price;
  27.     }
  28.  
  29.     public void setPrice(double price) {
  30.         this.price = price;
  31.     }
  32.  
  33.     @Override
  34.     public String toString() {
  35.         return "Product [id=" + id + ", name=" + name + ", price=" + price + "]";
  36.     }
  37.  
  38.     public Product(int id, String name, double price) {
  39.         super();
  40.         this.id = id;
  41.         this.name = name;
  42.         this.price = price;
  43.     }
  44.  
  45.     public Product() {
  46.         super();
  47.     }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement