Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nextone;
- public class Product {
- public static void main(String[] args) {}
- private double price;
- private String name;
- public Product()
- {
- this.name = "";
- this.price = 0.0;
- }
- public Product(double initialPrice, String initialName)
- {
- this.price = initialPrice;
- this.name = initialName;
- }
- public String getName()
- {
- return this.name;
- }
- public void setPrice(double price)
- {
- this.price = price;
- }
- public double getPrice()
- {
- return this.price;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement