-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestJava.java
More file actions
30 lines (30 loc) · 987 Bytes
/
TestJava.java
File metadata and controls
30 lines (30 loc) · 987 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
package hexa;
public class TestJava{
public static void main(String[] args) {
Student sEmpty = new Student();
Student sParam = new Student("rr","java");
Student sParam2 = new Student("rr","java");
System.out.println(sEmpty);
System.out.println(sParam);
if (sParam.equals(sParam2)) {
System.out.println("param1 and param2 are EQUAL");
}
else {
System.out.println("param1 and param2 are NOT EQUAL");
}
sEmpty.setName("rr");
sEmpty.setCourse("java");
if (sEmpty.equals(sParam2)) {
System.out.println("EMPTY and param2 are EQUAL");
}
else {
System.out.println("EMPTY and param2 are NOT EQUAL");
}
boolean ret =sParam.validateCourse();
System.out.println("return value is "+ret);
ret =sParam.validateCourse("java");
System.out.println("return value is "+ret);
ret =sParam.validateCourse("C++","java");
System.out.println("return value is "+ret);
}
}