Today I gave an interview, one question i was asked is that " when object is created each object got different copy of data member (non static), does all objects have their own copy of non static methods" I replied no only data memebers r contained not methods, AM I RIGHT. Yasir Sufyan
Methods, static and non-static, are held in the Method area that is created one time at Class Load time. They are in no way involved with the instance objects that are on the heap. Objects ONLY hold the values of the fields (member variables) which define the STATE of the object, NOT the behaviors of the object.
"JavaRanch, where the deer and the Certified play" - David O'Meara