-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProduct.java
More file actions
47 lines (37 loc) · 910 Bytes
/
Product.java
File metadata and controls
47 lines (37 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//Product.java
//created by: Daniel Myers
import java.io.Serializable;
public abstract class Product implements Serializable {
private static final long serialVersionUID = 8075372467117611630L;
private String title;
private double price;
private Date purchaseDate;
public Product(String t, double p, Date pD){
setTitle(t);
setPrice(p);
setPurchaseDate(pD);
}
public void setTitle(String t){
title = t;
}
public String getTitle(){
return title;
}
public void setPrice(double p){
price = p;
}
public double getPrice(){
return price;
}
public void setPurchaseDate(Date pD){
purchaseDate = pD;
}
public Date getPurchaseDate(){
return purchaseDate;
}
public abstract void setNumberOfSongsPurchased(int nOSP);
public abstract int getNumberOfSongsPurchased();
public String toString(){
return (getTitle() + " " + getPrice() + " " + getPurchaseDate());
}
}