-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhashtable.java
More file actions
67 lines (29 loc) · 804 Bytes
/
Copy pathhashtable.java
File metadata and controls
67 lines (29 loc) · 804 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
/******************************************************************************
Online Java Compiler.
Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
import java.util.*;
import java.lang.*;
public class Main
{
public static void main(String[] args) {
Hashtable h=new Hashtable();
h.put(new summa(4),2);
h.put(new summa(7),4);
h.put(new summa(9),1);
System.out.println(h);
}
}
class summa{
int i;
summa(int i){
this.i=i;
}
public int hashCode(){
return i;
}
public String toString(){
return i+" ";
}
}