-
Notifications
You must be signed in to change notification settings - Fork 1
/
Attribute.java
48 lines (36 loc) · 1.01 KB
/
Attribute.java
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
48
//Attribute.java
//grace nguyen
//march 10, 2022
import java.io.*;
abstract class Attribute implements Serializable {
//attributes
Double status;
String name;
public static void main(String[] args) {
//class testing
//Attribute grace = new Attribute("Happy", 5.0);
//grace.increment(0.01);
//System.out.println(grace.getStatus());
} //end main
//constructor
public Attribute(String name) {
this.name = name;
} //end constructor
public Attribute(String name, double status) {
this.name = name;
this.status = status;
} //end constructor
//getters and setters
public String getName() {
return(this.name);
} //end getName
public double getStatus() {
return(this.status);
} //end getStatus
//abstract classes
public abstract void setStatus(Double status);
public abstract void increment();
public abstract void increment(double amount);
public abstract void decrement();
public abstract void decrement(double amount);
} //end class def