Advertisement
desant74268

OOPHW

Jan 15th, 2022
736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package ru.itsjava.oop.oopHW;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.  
  6.         Lion myfasa = new Lion("Myfasa");
  7.         Lion shram = new Lion("Shram");
  8.  
  9.  
  10.         myfasa.sayR();
  11.         shram.sayR();
  12.  
  13.         Human dima = new Human("Dmitriy", 30);
  14.  
  15.         dima.greeting();
  16.  
  17.         Iron lg = new Iron(100);
  18.         System.out.println("Price LG: " + lg.getPrice());
  19.  
  20.         Iron samsung = new Iron("Samsung",100,"White");
  21.         System.out.println("samsung.getColor() = " + samsung.getColor());
  22.         System.out.println("samsung.getPrice() = " + samsung.getPrice());
  23.         samsung.setPrice(200);
  24.         System.out.println("samsung.getPrice() = " + samsung.getPrice());
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement