Re: static member scope.
From: John Saunders (johnwsaundersiii)
Date: 12/16/04
- Next message: Morten Wennevik: "Re: Calling unmanaged code from managed code"
- Previous message: John Vottero: "Re: Copy protection for a .NET application"
- In reply to: Subramanian: "static member scope."
- Next in thread: cecil_at_ceciltech.com: "Re: static member scope."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Dec 2004 13:14:14 -0500
"Subramanian" <subramanian.iyer@spam.kla-tencor.com> wrote in message
news:03f701c4e392$9fb6bc60$a301280a@phx.gbl...
> Any specific reason of not giving acces to the static
> members of a class, from the objects of the class.
>
> Code Snippet:
>
> Class a
> {
> public static int stInteger;
> }
> class Test
> {
> static void Main()
> {
> a obja =new a();
> Console.WriteLine(obja.A);
> }
> }
> ----
> Gives a compilattion erro.
That's because these are members of the class, not of the object obja. Try
a.stInteger.
John Saunders
- Next message: Morten Wennevik: "Re: Calling unmanaged code from managed code"
- Previous message: John Vottero: "Re: Copy protection for a .NET application"
- In reply to: Subramanian: "static member scope."
- Next in thread: cecil_at_ceciltech.com: "Re: static member scope."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|