开发者

Is there the generic properites

Is there a generic properties in Java?

Properties taks generic Hashmap inside, but itself seems is nongenric, is there generic propert开发者_开发技巧ies?


Not in the standard API. You would have to roll your own (which by the way is quite easy).

Still though, I'm not sure I see any use of it. If the class itself should be non-generic, i.e. have a non-generic interface, what does it matter if it's internal structure is generic or not?


its EntrySet method is coming from HashMap which returns Map, I want something returned to be Map

Yes, that is unwieldy. Since JDK1.6 there is at least a getStringPropertyNames, which returns a Set<String> (as opposed to the old Enumeration<?>).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜