Using int as a type parameter for java.util.Dictionary

后端 未结 6 2142
孤独总比滥情好
孤独总比滥情好 2021-02-06 22:51

When I try to declare a Dictionary as such:

private Dictionary map;

The compiler gives me the following error:

6条回答
  •  长发绾君心
    2021-02-06 23:34

    Because in Java the primitives are truely primitives. In Java int will pass by value, while Integer will pass a reference. In .NET int or Int32 etc. are just different names.

提交回复
热议问题