Hi,
Can a hashcode overridden from Object, can return other than int.
Because i can an object which has teh value that sis greater then the int can hold.No way of reducing the value of my object, because i have to check against the same object.I even tried dividing the value by some int to make it smaller value so taht it can fit in int, this case recults me in same hashcode for different objects.
String pid = "P1/000032";
String cid = "20"
public int hashCode(){
StringBuffer tempProj = new StringBuffer(50);
tempProj.append(pid.replaceAll("/","").replaceAll("T","3").replaceAll("P","2").replaceAll("C","1").replaceAll("D","4"));
long lValue = Long.parseLong(tempProj.toString())/(Integer.parseInt(cid)*99);
return (int)lValue;
}
Above code returns 10606 for pid = "P1/000032" and also "P1/000034".Help please.