gpt4 book ai didi

java - 创建内部类对象时无法理解赋值运算符右边部分的逻辑

转载 作者:行者123 更新时间:2023-11-29 09:27:57 25 4
gpt4 key购买 nike

<分区>

我在搜索的问题中没有找到我的答案,这就是我问它的原因。

class outer 
{
class inner // non static .
{
}
}

For creating object of inner class I am unable to understand the logic of the part to the right of assignment operator .

outer o = new outer () ;
outer.inner y = o. new inner () ; // I have doubt in this line .

这里 outer.inner 是返回类型,但是正确的部分呢?

我知道的事情:我们不能写 outer.inner y = new outer.inner () ;因为 inner 是非静态的。

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