Java - How to decide if a member should belong to instance or be made static ?


Static members belong to the class and hence common to all instances, whereas instance variables have values which is unique to an instance. 


We have used Flower class to make two objects, flower1 and flower2. Now as different flowers can have different colors, we should make the property "color" as instance variable only. 

But If we expect all flowers to have a common color, the color property should be made static so as to avoid extra memory overhead and unnecessary setting the same color for each instance. Moreover if we have the variable as instance in such case, it will allow setting some other color for instances which is not desired.