Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么将基本类型的一维数组作为参数传入Arrays.asList方法时,反编译class文件会看到传入了一个二维数组? #875

Open
Rorke76753 opened this issue Jul 29, 2020 · 1 comment
Labels

Comments

@Rorke76753
Copy link

@Rorke76753 Rorke76753 commented Jul 29, 2020

在看完了这篇之后,我也去试了一下相同的代码,反编译后的结果如下:
微信截图_20200729182325
请问是否有相关资料来说明这么编译的原因吗?

@Rorke76753
Copy link
Author

@Rorke76753 Rorke76753 commented Jul 31, 2020

额,看了一下该方法。该方法需要的是对象数组,传入基本类型数组的时候会变为数组对象。如有纰缪请多多指教。

@Rorke76753 Rorke76753 closed this Jul 31, 2020
@Rorke76753 Rorke76753 reopened this Jul 31, 2020
@Rorke76753 Rorke76753 changed the title 请问jvm为什么在使用asList方法时会将primitive的一位数组编译成二维数组? 为什么将基本类型的一维数组作为参数传入Arrays.asList方法时,反编译class文件会看到传入了一个二维数组? Jul 31, 2020
@Snailclimb Snailclimb added the question label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.