Matthew Brown wrote:What makes you think the capacity should be doubled? For instance, if you look at the Javadocs for the ensureCapacity method:
The new capacity is the larger of:
- The minimumCapacity argument.
- Twice the old capacity, plus 2.
If that's the behaviour whenever the capacity is increased, it would explain what you saw.
Bear Bibeault wrote:That is exactly the question that Henry addressed.
Let's turn this around -- why don't you explain why it should?
Bear Bibeault wrote:It returns the container's implementation of the ServletContext interface.
Lucky J Verma wrote:Static Variable= Defined at Class Level
Instance Variable =Defined at Instace/Object Level.
Static Variables are initialized ,loaded with Class itself.
But instance variable initialized when Object for that Class is instantiated.
In other words - For 1 class ,its different objects can have different values for same instance variable.(Each instance =can have its own value)
But for same class ,static variable (since belongs to class itself ) -same value is shared by each object.