If I declare one variable in a servlet class, and if I create many instances of that servlet, what will be the status of that variable?
If the variable is not static, there will be separate instances of that variable in each servlet and the value of the variable in one
instance will not be reflected in another. If the variable is static, it will be shared by all servlets running in the same servlet container that were loaded by the same class loader. In general, it is a bad idea to use static variables to share information between multiple instances of the same servlet.