-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
78 lines (68 loc) · 1.45 KB
/
Student.java
File metadata and controls
78 lines (68 loc) · 1.45 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package hexa;
import java.util.Objects;
public class Student
{
static int count=0;
final String College="Vidya";
private String name;
private String course;
void incStudent()
{
count++;
}
public static void dispCount()
{
System.out.println("Number of students "+count);
}
public Student()
{
incStudent();
}
public Student(String name,String course)
{
incStudent();
this.name=name;
this.course=course;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCourse() {
return course;
}
public void setCourse(String course) {
this.course = course;
}
@Override
public String toString() {
return "Student [College=" + College + ", course=" + course + ", name=" + name + "]";
}
public int hashCode()
{
return Objects.hash(this.name,this.course);
}
public boolean validateCourse() {
if (this.course.compareTo("java")==0)
return true;
else
return false;
}
public boolean validateCourse(String argCourse) {
if (this.course.compareTo(argCourse)==0)
return true;
else
return false;
}
public boolean validateCourse(String argCourse1, String argCourse2) {
if (argCourse1.compareTo(argCourse2)==0)
return true;
else
return false;
}
public static void main(String[] args)
{
}
}