Java – internal class extension

In Java, I have the following classes:

public class A{
  protected class B{
  }
}

Can internal classes be extended in the following ways?

public class C extends A{
  protected class D extends B{
  }
}

What I want to do is that I have class C above. I need to change the internal class of a, so I think I need to extend the internal class to do it, but I don't know how to do it

Solution

According to this page, you have the right way to expand internal courses Some tips on this can be found here (search for "extension")

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>