Software Code
    New Code     Most Interesting     Don't Miss     Our picks  
C# - section

View Article
C# Properties ?
C# property creation.
In C# you can define properties for a member variable.
Let us assume that you have a member variable called _iCount of type int in a class called MyClass.
For this member variable you can define a property which you can then use to access the actual member variable:

public class MyClass
//Member variables
private int _iCount;

//Class constructors
public myClass(int paramCount)
_iCount = paramCounter;

//Properties for member variables
public int Count
return _iCount;
_iCount = value;
Date: 2007-9-8    Written by: Admin A
     See all articles in this section
Copyright © 2007-2009 SoftwareRiviera.com. All rights reserved.  | Terms of use | Disclaimer | Privacy Policy |