Click here to Skip to main content
16,021,181 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: (untagged)
No Question Here...........................
Posted
Updated 4-Apr-12 3:46am
v6
Comments
fjdiewornncalwe 2-Apr-12 17:21pm    
This is all well and good, but you haven't asked a question. What exactly is your problem. All you have done is tell us what you are trying to accomplish. Tell us what you have tried and where things have broken down.
Sergey Alexandrovich Kryukov 2-Apr-12 20:15pm    
Not too helpful. How about marking those lines 6, 7 and 8 in your code sample?
--SA

1 solution

These all are compilation errors. They say that you should use the reference to the instance of the class, because you use instance members (non-static ones), not the class itself. You should have used class name instead of instance variable to work with static members — they are not related to any instance, but to the class itself.

You can read some background explanation in my past answer:
What makes static methods accessible?[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900