Advertisement
Guest User

подкласс

a guest
Oct 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. package DairyProduct;
  2.  
  3. public class Yoghurt extends Dairy {
  4.      String taste;
  5.     int volume;
  6.     int termalization;
  7.    
  8.     public Yoghurt() {
  9.         super();
  10.         taste = "Vanilla";
  11.         volume = 100;
  12.         termalization = 100;
  13.     }
  14.    
  15.     public Yoghurt(String exp, int prot, int f, String prod, String ta, int v, int te) {
  16.         super(exp, prot, f, prod);
  17.         taste = ta;
  18.         volume = v;
  19.         termalization = te;
  20.     }
  21.    
  22.     public Yoghurt (int prot, int f, String prod, int v) {
  23.         super (prot, f, prod);
  24.         volume = v;
  25.     }
  26.    
  27.     public String getTaste() {
  28.         return taste;
  29.     }
  30.     public int getVolume() {
  31.         return volume;
  32.     }
  33.     public int getTermalization() {
  34.         return termalization;
  35.     }
  36.     private void setProducer (String p) {
  37.         this.producer = p;
  38.     }
  39.     public String getProducer () {
  40.         return producer;
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement