thanks for the clarification. nice java refresher.

  ----- Original Message ----- 
  From: Dean H. Saxe 
  To: SQL 
  Sent: Wednesday, January 16, 2002 9:47 AM
  Subject: Re: Database configuration ?


  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
  
______________________________________________________________________
Macromedia ColdFusion 5 Training from the Source
  Step by Step ColdFusion
  http://www.amazon.com/exec/obidos/ASIN/0201758474/houseoffusion
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to