Advertisement
MattPlummer

3.10

Oct 1st, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package nextone;
  2.  
  3. public class Product {
  4.  
  5.     public static void main(String[] args) {}
  6.          private double price;
  7.          private String name;
  8.  
  9.      public Product()
  10.      {
  11.          this.name = "";
  12.          this.price = 0.0;
  13.      }
  14.  
  15.      public Product(double initialPrice, String initialName)
  16.      {
  17.          this.price = initialPrice;
  18.          this.name = initialName;
  19.      }
  20.  
  21.      public String getName()
  22.      {
  23.          return this.name;
  24.      }
  25.  
  26.      public void setPrice(double price)
  27.      {
  28.          this.price = price;
  29.      }
  30.  
  31.      public double getPrice()
  32.      {
  33.          return this.price;
  34.      
  35.    
  36.  
  37.  
  38.  
  39.     }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement