Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. class Product {
  2.     private int catId;
  3.     private int channelPrice;
  4.  
  5.     public Product(int catId) {
  6.         this.catId = catId;
  7.         this.channelPrice = -1;
  8.     }
  9.  
  10.     public Product(int catId, int channelPrice) {
  11.         this.catId = catId;
  12.         this.channelPrice = channelPrice;
  13.     }
  14. }
  15.  
  16. class Category {
  17.     private int id;
  18.     private Category parent;
  19.     private int price;
  20.  
  21.     public Category(int id, Category parent) {
  22.         this.id = id;
  23.         this.parent = parent;
  24.         this.price = -1;
  25.     }
  26.  
  27.     public Category(int id, Category parent, int price) {
  28.         this.id = id;
  29.         this.parent = parent;
  30.         this.price = price;
  31.     }
  32.  
  33.     public int getPrice() {
  34.         return this.price;
  35.     }
  36.  
  37.     public void setPrice(int price) {
  38.         this.price = price;
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement