search

Home  >  Q&A  >  body text

Java Map<String, Object>.class报错,编译提示“需要标识符”,这是怎么回事?

如上图所示

怪我咯怪我咯2804 days ago2942

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 18:00:14

    This should be a syntax issue, and it has nothing to do with generics

    can only be written as class name.class, which is the syntax agreed by java

    reply
    0
  • PHPz

    PHPz2017-04-17 18:00:14

    Because Java’s generics are pseudo-generic, you need to use Map.class

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 18:00:14

    This is the basic syntax of java

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 18:00:14

    **

    获取当前对象的三种方式:
    1.类名.calss
    2.Class.forName("类的完整路径");
    3.对象.getClass()
    

    **

    reply
    0
  • Cancelreply