Advertisement
micher43

E3.10 (Product)

Oct 1st, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. public class Product {
  2.     private String name;
  3.     private double price;
  4.    
  5.     /**
  6.      * constructor
  7.      */
  8.     public Product(String productName , double productPrice){
  9.         name = productName;
  10.         price = productPrice;
  11.     }
  12.    
  13.     public String getName(){
  14.         return name;
  15.     }
  16.    
  17.     public double getPrice(){
  18.         return price;
  19.     }
  20.    
  21.     public void reducePrice(double byAmount){
  22.         price = price - byAmount;
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement