java - 缩进接口(interface)的多个实现的公认做法是什么

标签 java interface standards indentation

如果我有一个实现多个监听器的类,可接受的间距是多少?

现在我正在这样做:

public class MyClass 
    implements interface1,
    interface2,
    interface3,
    interface4,
    interface5 {

最佳答案

我会选择:

public class MyClass implements Interface1, Interface2, 
        Interface3, Interface4, Interface5 {

这里,第二行有两个缩进。

只需确保组织中的每个人都使用相同的风格即可。

关于java - 缩进接口(interface)的多个实现的公认做法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37039587/

相关文章:

rust - 如果从模块导出的项目暴露了内部代码,如何组织内部代码?

java - 抽象类和接口(interface)中相同的方法具有不同的返回类型

validation - 验证逻辑应该在哪里实现?

java - 将时间段分割为每小时间隔

java - Nginx 代理 : How do I configure nginx so that Jersey 2 (JAX-RS 2) still can interact with additional URL parts in it properly?

java - 为什么我收到此错误 : data structures (arrays)?

javascript - 接口(interface)中TypeScript函数声明的区别

html - 内联元素中的 block 级元素

c# - 带有 ISAPI 文件夹的命名空间标准

java - Java 7 中的闭包如何工作?