-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathStudent.java
More file actions
62 lines (46 loc) · 1.31 KB
/
Student.java
File metadata and controls
62 lines (46 loc) · 1.31 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package org.launchcode.java.demos.lsn3classes1;
// Start working here with your Student class.
// To instantiate the Student class, add your code to the main in the file, SchoolPractice.
public class Student {
private String name;
public String getName() {
return name;
}
public Student(String name) {
this.name = name;
}
public Student(String name, int studentId, int numberOfCredits, double gpa) {
this.name = name;
this.studentId = studentId;
this.numberOfCredits = numberOfCredits;
this.gpa = gpa;
}
public int getStudentId() {
return studentId;
}
public void setStudentId(int studentId) {
this.studentId = studentId;
}
public int getNumberOfCredits() {
return numberOfCredits;
}
private void setNumberOfCredits(int numberOfCredits) {
this.numberOfCredits = numberOfCredits;
}
public double getGpa() {
return gpa;
}
public void setGpa(double gpa) {
this.gpa = gpa;
}
public Student(String name, int studentId) {
this.name = name;
this.studentId = studentId;
}
public void setName(String aName) {
name = aName;
}
private int studentId;
private int numberOfCredits = 0;
private double gpa = 0.0;
}