i would like to ask the question when it would be advantageous to use static variables/methods or in the other case instance variables/methods in Java?
I know that it depends on the certain case (like programming util-classes as static methods), but can we declare something like a general strategy?
At novice level :
Use instance variables when : Every variable has a different value for different object. E.g. name of student, roll number etc..
use static variables when : The value of the variable is independent of the objects (not unique for each object). E.g. number of students.