Are you referring to having member variables in your servlet? If so then yes, you may declare it. It is generally recommended that your servlet not have member variables because they are not thread safe.
Just to amplify what Matthew said - you should not use member variables for anything that is user specific. Remember that more than one request can be processed "at the same time" in a servlet object. Its ok to use a member variable or a static variable for something that does not relate to a specific user. Bill