You want a private variable and a public static accessor/mutator pair:

public class test {

  private static int var;

  public static void setVar(int i) {
    var = i;
  }

  public static int getVar() {
    return var;
  }

}

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, January 26, 2005 2:11 pm, PA said:
> 
> On Jan 26, 2005, at 20:08, Ashish Kulkarni wrote:
> 
>> how do i protect it from updated
>> by any other class.
> 
> Just don't. Use a static accessor method instead.
> 
> Cheers
> 
> --
> PA
> http://alt.textdrive.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to