In Java, can we divide a class into multiple files

后端 未结 2 873
予麋鹿
予麋鹿 2021-02-11 12:36

Any possibility to divide a class into multiple physical files using Java?

2条回答
  •  长情又很酷
    2021-02-11 13:20

    No, the whole of a class has to be in a single file in Java.

    If you're thinking of C#'s "partial types" feature, there's no equivalent in Java. (If you weren't thinking of C#, ignore this :)

提交回复
热议问题