C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 1798 Page Views: 

How is a read-only property defined in C#?



Posted By: Avi Date: 5 February 2010 01:51:32 PM
 Answer:

public returntype PropertyName
{
get
{
//property implementation goes here
}

// Do not write the set implementation
}


Posted By: eTechPlanet


Date: 5 February 2010 01:51:32 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image 3uu6eP
Related Questions
C# : How do you call parallel version of foreach loop?

How do you call parallel version of foreach loop?

Parallel.ForEach<Test>(list, (i) => i.DoSomething());
Category: C# Date: 10/13/2010 1:42:47 PM
C# : How do you format integer to output hexadecimal value?

How do you format integer to output hexadecimal value?

String.Format(“{0:x}”, 100);
Category: C# Date: 10/13/2010 1:32:46 PM
C# : Can you use goto in c# programs?

Can you use goto in c# programs?

Yes
Category: C# Date: 10/13/2010 12:49:47 PM
C# : Can you define more than one class in one file?

Can you define more than one class in one file?

Yes
Category: C# Date: 10/13/2010 12:31:14 PM
C# : How can you list methods of given object?

How can you list methods of given object?

Type t = typeof(o); System.Reflection.MethodInfo[] methodInfo = t.GetMethods();
Category: C# Date: 10/13/2010 12:00:14 PM