You are absolutely right that in the end everything starts from a static method main(). And many functions are suitable for static, for example. simple methods such as on java.lang.Math. Speed and memory usage are not a problem - the static method does not take up more memory or runs slower than any other method. Internally, it is exactly the same as any other method, but it is defined and executed on the class instance instead of the class instance.
, , , (, ), . . , , , , ) I/O - . -. , . .
, - . , " " .
, , Apache Commons IO, Google Guava .. , . , .