The one major diff that I can think of is, the instance variables may have different values for different objects/instances created for the class they are in, whether the instance variables are being accessed by different threads or not. Where as no matter how many instances of the class you make, the value of static variable is same throughout the jvm (please refer the code snippet for this example.).
Main Topics
Browse All Topics





by: objectsPosted on 2008-12-06 at 23:04:49ID: 23114978
there is no difference, statics also need to be checked for thread safety.