The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Static Members

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

static variables in class methods

Posted by Siva on December 31, 2001 at 1:38 AM

why is it that it is NOT possible to have static variables in a non-static member fn. of a class ..
eg:
class test {

public int function1 {
static int i;
}
}

the java compiler gives an erro on seeing the static int i;

thanks,
Siva



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us