Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Model;
- import java.util.ArrayList;
- public class Bike {
- private int id;
- private static int count = 0;
- private String type;
- private double price;
- public Bike () { // non-arg constructor
- this.id = count++;
- }
- public Bike (String type, double price) { // constructor with type and price
- this.type = type;
- this.price = price;
- }
- /** getters */
- public int getId() {
- return id;
- }
- public String getType() {
- return type;
- }
- public double getPrice() {
- return price;
- }
- /** setters */
- public void setId(int id) {
- this.id = id;
- }
- public void setType(String type) {
- this.type = type;
- }
- public void setPrice(double price) {
- this.price = price;
- }
- }//class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement