Extract static methods from main() file in java -
i'm quite new java , wrote little to-do list project. @ beginning of project added bunch of static methods file main() code is, , got little out of hand. want transfer these methods file. there proper way this, or have create sort of behaviour class these methods, , in main() create instance of call it's methods?
you can extract these methods separate class (say fooutils
), , in main method can call them using class name - fooutils.somestaticmethod()
depending on have, may make sense group methods different classes, or make them instance methods.
Comments
Post a Comment