1.

How to declare a property in a class in C#?

Answer»
class ABC
{
// Declare the attribute
private int id;
// Declare id’s property
public int ID
{
// read-only getter property
get { return id; }
set { id = value; }
}
}


Discussion

No Comment Found