-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHash.java
More file actions
25 lines (19 loc) · 783 Bytes
/
Copy pathHash.java
File metadata and controls
25 lines (19 loc) · 783 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
package hash;
import hash.BlackBox;
public class Hash extends Object {
public static void main(String[] args) {
Object obje3ct = new Object();
int hCode;
BlackBox object1 = new BlackBox(5, 10);
BlackBox object2 = new BlackBox(5, 10);
BlackBox object3 = new BlackBox(5, 10);
boolean a = object1.hashCode() == object2.hashCode();
System.out.println("a равно " + a);
BlackBox object4 = object3;
boolean b1 = object1.equals(object2);// должно быть true
System.out.println(object1.hashCode() == object2.hashCode());// должно быть true
System.out.println(object1.equals(object2));
boolean b = object3.equals(object4);
System.out.println(b1);
}
}