在Java中创建地图,参数错误 [英] Creating a map in Java, parameter error

查看:153
本文介绍了在Java中创建地图,参数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有这段代码:

Map<Double, Character> memory = new HashMap<Double, Character>();

但是编译时返回此错误:

However it returns this error upon compiling:

GameLogic.java:5: type Map does not take parameters
Map<Double, Character> memory = new HashMap<Double, Character>();
   ^
1 error

我不知道为什么它这样做看到其他问题后,看到没有理由。它属于GameLogic类。

I have no idea why its doing this as I see no reason it should after looking at other questions. It is within the 'GameLogic' class. Please could someone help.

推荐答案

两个可能的错误:


  • 您正在使用JKD 1.4

  • 您导入的内容不是 java.util.Map

  • You are using JKD 1.4
  • You imported something else than java.util.Map

这篇关于在Java中创建地图,参数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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