的hashCode() [英] hashCode()

查看:54
本文介绍了的hashCode()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经使用这些字符串的hashCode包装到对象中的字符串.......现在我想知道如何从对象中获取这些字符串.. .............我把这个对象作为HashMap中的一个键.....更多细节请看这里

推荐答案




我已经使用这些字符串的hashCode包装到对象中的字符串.......现在我想知道如何从对象中获取这些字符串.......... .....我把这个对象作为HashMap中的一个键.....更多细节请点击这里< a href =''http://www.thescripts.com/forum/thread675010.html'' >交< / A>
Hi,
I have wrapped to strings in a object using hashCode of these strings.......Now I want to know how can I get back these strings from the object...............I am putting this object as a key in a HashMap.....For more details kindly this <a href = ''http://www.thescripts.com/forum/thread675010.html''>post</a>



为什么(以及如何)使用hashCode从字符串中生成对象?

也许如果你发布你的代码......

Why (and how) did you use hashCode to make objects out of the Strings?
Maybe if you post your code ...



为什么(以及如何)使用hashCode从字符串中生成对象?

也许如果你发布你的代码...
Why (and how) did you use hashCode to make objects out of the Strings?
Maybe if you post your code ...



如果你看看那个超链接.......然后你会得到我想说的这里.. ....通过d方式代码如下: -


If you will look at that hyperlink.......then you will get what I am trying to say here......by d way code is like:-

展开 | 选择 | Wrap | 行号



如果你看看那个超链接.......那么你会得到我想说的......这里的代码如下: -
If you will look at that hyperlink.......then you will get what I am trying to say here......by d way code is like:-



我看到了。再看看乔斯的例子。你的构造函数在哪里取两个字符串?

如果你想单独获取每个字符串,只需为它们提供getter。这与hashCode无关。

I saw it. Look at Jos''s example again. Where''s your constructor that takes the two strings?
If you want to get each string individually, just provide getters for them. That has nothing to do with hashCode.


这篇关于的hashCode()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆