I have a java library of classes with lots of static methods that do things like getRandom numbers between a range, populate arrays with random numbers, find number statistics of arrays like average and median, getValid keyboard input ect... My question is since there static methods can be used without an import statement and does not need to be instantiated with the new keyword, Is this library taking up more memory for its methods if I only need to use one method in my program
If I am being ambiguous, This is what I mean. I am creating a my own java utility library that have many utility methods. It might have say 100 methods, I will call it LIBRARY X. Now I am making a new program PROGRAM Y. Program Y used only 1 method out of 100 from Library X, will program Y load all 100 methods if I only need 1. How can I avoid loading the whole library if its not needed, or does java load only the methods invoked by the program already.