Advertisement
Bene2468

Untitled

May 7th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package Model;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. public class Bike {
  6.    
  7.     private int id;
  8.     private static int count = 0;
  9.     private String type;
  10.     private double price;
  11.    
  12.     public Bike () { // non-arg constructor
  13.         this.id = count++;
  14.     }
  15.    
  16.     public Bike (String type, double price) { // constructor with type and price
  17.         this.type = type;
  18.         this.price = price;
  19.     }
  20.  
  21.     /** getters */
  22.     public int getId() {
  23.         return id;
  24.     }
  25.     public String getType() {
  26.         return type;
  27.     }
  28.     public double getPrice() {
  29.         return price;
  30.     }
  31.  
  32.     /** setters */
  33.     public void setId(int id) {
  34.         this.id = id;
  35.     }
  36.     public void setType(String type) {
  37.         this.type = type;
  38.     }
  39.     public void setPrice(double price) {
  40.         this.price = price;
  41.     }
  42.  
  43. }//class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement