私が検索した質問で私の答えを見つけられなかったので、私はそれを求めています。内部クラスのオブジェクトを作成するときに代入演算子の右側のロジックを理解できません
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();インナーは静的ではないからです。
Javaの命名規則に従ってください。 –
その先のことを試しましたか? – GhostCat