代码之家  ›  专栏  ›  技术社区  ›  Fostah

静态内部Util类的性能副作用?

  •  1
  • Fostah  · 技术社区  · 16 年前

    class ComponentUtil {
        static class Layout {                    
            static int calculateX(/* ... */) {
                // ...
            }
    
            static int calculateY(/* ... */) {
                // ...
            }
        }
    
        static class Process {
            static int doThis(/* ... */) {
                // ...
            }
    
            static int doThat(/* ... */) {
                // ...
            }
        }
    }
    

    使用这些内部类与只使用Util类中的所有功能相比,是否有任何性能下降?

    1 回复  |  直到 16 年前
        1
  •  4
  •   Riduidel    16 年前

    ComponentUtil$Layout . 希望对这个类的引用能在整个项目中得到解决。但在运行时,它会被认为是一个完全独立的类。