CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Location
    Torture chamber
    Posts
    132

    Unhappy A question about types

    I understand that C#.NET basically contains 2 types namely reference types(classes) & value types(int,byte etc.), therefore I have the following enquiries:

    Class Point
    {
    //fields
    public int x;

    //properties
    public int X
    {
    get{return x;}
    set{x = value;}
    }
    }

    In this case, is it correct to label Point.X as a reference type and Point.x as a value type?

    Please pardon me for asking such a stupid question for I am still a newbie(2 days old). Thank you all very much : )
    end------------------------------
    Programmers aren't born, but are made from hardwork, effort and time.
    To be a good one, requires more effort and hardwork.
    Therefore N quality programmer = (N*hardwork)+(N*effort)+(N*time)

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    no its a property value... its not a reference.

    Paresh

  3. #3
    Join Date
    Oct 2002
    Location
    Torture chamber
    Posts
    132
    I see. Thank you : )
    end------------------------------
    Programmers aren't born, but are made from hardwork, effort and time.
    To be a good one, requires more effort and hardwork.
    Therefore N quality programmer = (N*hardwork)+(N*effort)+(N*time)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured