dot net interview questions and answers
Home
C#.NET
ASP.NET
SQLServer
AJAX
XML
CSS
JAVASCRIPT
VIDEOS
Monday, February 8, 2010
How to add a ReadOnly property in C#.NET?
Properties can be made read-only by having only a get accessor in the implementation.
public class X
{
public X(int id)
{
x_id = id;
}
public int ID
{
get
{
return x_id;
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment