有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    JLS (Java Language Specification)开始:

    It is a compile-time error if the return type of a method declared in an annotation type is not one of the following: a primitive type, String, Class, any parameterized invocation of Class, an enum type (§8.9), an annotation type, or an array type (§10) whose element type is one of the preceding types.

    下面是来自Eclipse java编译器的错误消息,更清楚一点:

    Invalid type String[][] for the annotation attribute A.twoArr; only primitive type, String, Class, annotation, enumeration are permitted or 1-dimensional arrays thereof