Performance side effect with static internal Util classes?

Posted by Fostah on Stack Overflow See other posts from Stack Overflow or by Fostah
Published on 2010-04-08T12:30:37Z Indexed on 2010/04/08 12:33 UTC
Read the original article Hit count: 179

Filed under:

For a util class that contains a bunch of static functionality that's related to the same component, but has different purposes, I like to use static internal classes to organize the functionality, like so:

class ComponentUtil {
    static class Layout {                    
        static int calculateX(/* ... */) {
            // ...
        }

        static int calculateY(/* ... */) {
            // ...
        }
    }

    static class Process {
        static int doThis(/* ... */) {
            // ...
        }

        static int doThat(/* ... */) {
            // ...
        }
    }
}

Is there any performance degradation using these internal classes vs. just having all the functionality in the Util class?

© Stack Overflow or respective owner

Related posts about java