Kousik Majumder wrote:Can I implement it using 2D array?
That wouldn't be my choice, unless one of the requirements was that there would be a fixed number of entries in the map.
If so how to implement hashcode and bucket etc.?
Normally it's the object being used as the key which implements hashCode(). Were you considering this as one of the "complexities" which you planned to remove? As for how to implement buckets, you would do that by writing some kind of Java code. I certainly wouldn't think a 2-dimensional array would be at all helpful there.
Need some code reference.
Code for what? You don't have any requirements yet. At least not that we can see... the single word "custom" doesn't tell us much about what you plan to do.
First, make sure you understand how hash tables work. If you understand that, then reading the source code of HashMap or implementing your own should not be too complex. (That Wikipedia article contains a lot of details - if you want something less elaborate I'm sure you can find easier tutorials about hash tables on the web).