理解某些Java源代码中引用的[[I.class]

理解某些Java源代码中引用的[[I.class],java,reflection,Java,Reflection,我正在看一些Java反射源代码,如下所示: Method fixTransparentPixels = TextureAtlasSprite.class.getDeclaredMethod("fixTransparentPixels", new Class[] { [[I.class }); 所引用的方法声明如下: private void fixTransparentPixels(int[][] p_147961_1_) {...} 我不理解的是[[I.class部分。现在,我知道实际的c

我正在看一些Java反射源代码,如下所示:

Method fixTransparentPixels = TextureAtlasSprite.class.getDeclaredMethod("fixTransparentPixels", new Class[] { [[I.class });
所引用的方法声明如下:

private void fixTransparentPixels(int[][] p_147961_1_) {...}
我不理解的是
[[I.class
部分。现在,我知道实际的
class[]
数组是用来确定您想要声明的方法的哪种形式(什么参数类型等),但是
[[I.class
实际上意味着什么

此外,当我试图自己编写此反射代码时,IDE在
[[I.class
位上给了我语法错误。有人能告诉我有关此的信息吗


干杯。

当使用
getDeclaredMethod(字符串名称、类…参数类型)
时,
参数类型必须是参数的类(显然)。因此在这种情况下
fixTransparentPixels
需要
int[]
,因此参数类型将是
int[][].[].Class

这将有助于:

TextureAtlasSprite.class.getDeclaredMethod("fixTransparentPixels", int[][].class);

[[I
int[][
的类的内部名称:
System.out.println(int[][].class.getName());
输出
[[I

或者
Class.forName(“[[I”)
=
int[][].Class


但是,在源代码中编写
[[I.class
是非法的。您应该改为编写
int[][].class

谢谢,这很有意义。