Not to be confused with
public static final which would be a constant.

M

At 10:47 16/01/2002 -0500, you wrote:
>At 09:36 AM 1/16/02 -0600, you wrote:
> >regarding the sentence in your post about moving data from instance
> >variables to class variables to avoid redundancy, i'm not sure what you
> >mean. i did take 'java' but haven't used it much. doesn't an instance
> >variable store a unique value of an object of a class while a class
> >variable refers to a static value (constant) that is shared by all
> >objects?
>
>Instance variables are always associated with an instance of a class (an
>object).  Class variables are shared across all instances of a single class
>(indicated by the static keyword in the variable declaration), modify its
>value in instance A and instances B-Z also reflect the change.
>
>For instance:
>
>public class TestClass
>{
>
>private String instanceVariable = "A variable which is unique between
>instances of this class";
>
>private static String classVariable = "A variable shared between all
>instances of this class.";
>
>
>public TestClass()
>{
>          // constructor
>}
>
>}
>
>-dhs
>
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to