Properties

  • C# provides a concept called properties to enable to create object oriented fields within the classes.
  • Properties use the keywords get and set to get the values from the variables and set the values in the variables.
  • Syntax:

    get

            {

                return variable;

            }

            set

            {

                variable = value;

            }

  • E.g.:    public int iPointy1

    {

                get

                {

                    return iPointy;

                }

                set

                {

                    iPointy = value;

                }

            }

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger