Re: PRIVATE VARIABLES WITHIN PUBLIC CLASS

VERONICA ROACH <[email protected]> Tue, 7 Feb 2006 04:42:35 -0800
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
thanks so much -

What I am understanding is -
Static - not a mystery - there is only ever 1 of them !!
Public - not a mystery - always accessible

For servlets - as long as the variables are defined within the POST
method even if the servlet container allows 20 servlet instances to
be invoked, each POST method owns his variables
and if there's only one instance, and all calls to the servlet go
thru this one instance, the variables are still safe ?
( I got around my problem by synchronizing the POST but will need to
change this to prevent slow-down - just clearing things up before I
launch into the changes )

I realise a class's private variables cannot be accessed from outside
directly - my confusion was regarding -instances- of a class and
whether private class level variables are unique when there are
multiple instances alive - I understand that this would normally be
yes.
- Veronica







__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

_________________________________________________________________________=
__
To unsubscribe, send email to [email protected] and include in the bo=
dy
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html