-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
36 lines (29 loc) · 711 Bytes
/
Copy pathStudent.java
File metadata and controls
36 lines (29 loc) · 711 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
package arraylistexample;
/**
* Student Class. Used in the ArrayList Example
* @author mafudge
*/
public class Student {
private String Name;
private double GPA;
public Student(String name, double gpa) {
this.Name = name;
this.GPA = gpa;
}
public String getName() {
return this.Name;
}
public String getName(String newName) {
return (this.Name = newName);
}
public double getGPA() {
return this.GPA;
}
public double setGPA(double newGPA) {
return (this.GPA=newGPA);
}
@Override
public String toString() {
return String.format("%s\t%f",this.Name, this.GPA);
}
}