Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Product {
- private String name;
- private double price;
- /**
- * constructor
- */
- public Product(String productName , double productPrice){
- name = productName;
- price = productPrice;
- }
- public String getName(){
- return name;
- }
- public double getPrice(){
- return price;
- }
- public void reducePrice(double byAmount){
- price = price - byAmount;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement