desant74268

OOPHW

Jan 15th, 2022
817
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. package ru.itsjava.oop.oopHW;
  2.  
  3. public class Iron {
  4.  
  5.     private String model;
  6.     private int price;
  7.     private String color;
  8.  
  9.     public Iron(String model, int price, String color) {
  10.         this.model = model;
  11.         this.price = price;
  12.         this.color = color;
  13.     }
  14.  
  15.     public Iron(int price, String color) {
  16.         this.price = price;
  17.         this.color = color;
  18.     }
  19.  
  20.     public Iron(int price) {
  21.         this.price = price;
  22.     }
  23.  
  24.     public Iron() {
  25.  
  26.     }
  27.  
  28.  
  29.     public String getModel() {
  30.         return model;
  31.     }
  32.  
  33.     public int getPrice() {
  34.         return price;
  35.     }
  36.  
  37.     public String getColor() {
  38.         return color;
  39.     }
  40.  
  41.     public void setModel(String model) {
  42.         this.model = model;
  43.     }
  44.  
  45.     public void setPrice(int price) {
  46.         this.price = price;
  47.     }
  48.  
  49.     public void setColor(String color) {
  50.         this.color = color;
  51.     }
  52. }
  53.  
Advertisement
Add Comment
Please, Sign In to add comment