Putting Nested Classes In Separate Files

后端 未结 3 429
终归单人心
终归单人心 2021-01-03 00:03

I have a file with nested classes, but it\'s becoming long enough to be unreadable. Is there a way I can break out the nested classes into separate files?

3条回答
  •  猫巷女王i
    2021-01-03 00:52

    Write unit-tests to cover the code you are going to refactor.

    Then use refactoring tools, e.g. Eclipse/JDT to extract each class. Run the tests for each refactoring job.

    For extra fun, you can do this without the unit tests.

提交回复
热议问题