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