U can either declare the variable public static or keep it in session .
Abhay
----- Original Message -----
From: arun prakash <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 21, 2000 4:58 AM
Subject: Caching variable....
> Hi All.,
> How can i cache the variables value in
> memeory in Java ??? For ex if i have a variable int i
> = 5; in a class which has a set method where its
> modified to 20...and a get method which just returns
> the value of i. Now first i will call the set method
> from another class.....now when i call the set method
> from a third program i want the value which was set by
> the second class but i'm getting it as 5...where as i
> want 20 if the set method is called.....before get.
>
> Thanx in advance.
> regards
> arun.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Calendar - Get organized for the holidays!
> http://calendar.yahoo.com/
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> 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
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
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