Re: static member scope.

From: John Saunders (johnwsaundersiii)
Date: 12/16/04


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



Relevant Pages

  • Re: Banned from Nonprofit groups meetings - What to do?
    ... member from its meetings, although he claims to ... falsely portrayed him and his actions to group members ... term "member" as one of art including by reason of its entailing ... mini-mellodrama to which you refer has occurred -- because of the here ...
    (misc.legal)
  • Re: Scout and Explorers
    ... Joint Explorer Scout Units are also not allowed. ... If they want to be involved in scouting then they join the Scout ... 18+ year olds cannot be members of an ESU. ... flouting the rules without damn good reason then they can kiss goodbye ...
    (uk.rec.scouting)
  • Re: F*** Off All Microsoft Users
    ... and that's a 'virtual Pearl Harbor' pulled off by our whole ... respect and reason? ... killing from your groups members. ... replying to, by snipping them, but not acknowledging that your snipping ...
    (microsoft.public.windowsxp.general)
  • Re: F*** Off All Microsoft Users
    ... and that's a 'virtual Pearl Harbor' pulled off by our whole ... respect and reason? ... killing from your groups members. ... replying to, by snipping them, but not acknowledging that your snipping ...
    (microsoft.public.win2000.general)
  • Live World are a bunch of fucking wankers
    ... REASON GIVEN ... As eBay.co.uk discussion boards are here for Community members to ... eBay, can anyone tell me if Clarice Cliff a good investment? ...
    (uk.people.consumers.ebay)