Don't you get a problem here that you try to make a static reference to a
non-static variable? 'instance' is non-static... 'getInstance' is static.

Arjan Houtman
[EMAIL PROTECTED]


>public class MyGlobalVar {
>  private MyGlobalVar instance = null;
>  // whatever other member data fields needed
>
>  private MyGlobalVar(...) {
>    // do whatever is needed to initialize MyGlobalVar
>  }
>
>  public static MyGlobalVar getInstance() {
>    if (instance == null) instance = new MyGlobalVar(...);
>
>    return instance;
>  }
>
>  // whatever other memeber methods needed
>  // most likely read-only methods
>}
>
>I think I got everything right there.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to