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
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to