gpt4 book ai didi

java - 下面的语句编译成功,为什么?

转载 作者:行者123 更新时间:2023-12-01 06:32:45 25 4
gpt4 key购买 nike

据我所知,Object是java中所有类中最 super 的类。但是,下面的代码我无法理解。请帮帮我。

Object c = new long[4];
Object d = new int[4];

最佳答案

In the Java programming language, arrays are objects (§4.3.1), are dynamically created, and may be assigned to variables of type Object (§4.3.2). All methods of class Object may be invoked on an array

来自Java Language Specification .

关于java - 下面的语句编译成功,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17394038/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com