Java注解annotation invalid type of annotation member

Java注解annotation : invalid type of annotation member


1、什么是invalid type of annotation member

字面意思是,这是一个无效的注解成员类型,虽然用户可以自己定义注解,但是自定义注解中能够包含哪些类型是有限制的

2、哪些类型是合法的

  • A primitive type
  • String
  • Class
  • An enum type
  • An annotation type
  • An array type

3、对应说明

  • A primitive type ===== java的八种基本类型:byte、short、int、long、float、double、char、boolean
  • String ===== 字符串
  • Class ===== 类型
  • An enum type ===== 枚举
  • An annotation type ===== 注解
  • An array type ===== 以上类型的数组形式
发布了442 篇原创文章 · 获赞 1375 · 访问量 210万+

猜你喜欢

转载自blog.csdn.net/qq_15071263/article/details/102912143