Answer the question
In order to leave comments, you need to log in
Where is the best place to put a Java static method?
If I have class User and App(launch cli app). There is a static function with random user generation. It will be more correct to shove it into the user class or can it be left in the App?
Answer the question
In order to leave comments, you need to log in
IMHO, it's more correct to introduce another class, UserFactory, which will do this. I disagree with Sergey, user generation is not behavior.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question