Nested/Inner class in external file

后端 未结 6 701
醉话见心
醉话见心 2021-01-07 15:57

I have a class MyClass and an inner class MyNestedClass like this:

public class MyClass {
  ...
  public class MyNestedClass {
             


        
6条回答
  •  悲&欢浪女
    2021-01-07 16:39

    You could create abstract base classes that you extend in both.

    However, if those classes are large, you might be better off re-evaluating your class design and see if you can refactor into classes which represent one concern each.

提交回复
热议问题