Download
100% FREE
Office Document APIs for .NET
Online: 1016
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
>
C#
>
Loading ...
How to declare a property in a class?
Posted by
SheoNarayan
on 5/8/2008 | Category:
C# Interview questions
| Views: 7069
Post
|
Interview FAQs
|
Exclusive Questions
|
Interview Home
Answer:
int m_PersonID = 0;
public int PersonID
{
get { return m_PersonID; }
set { m_PersonID = value; }
}
Asked In:
Many Interviews |
Alert Moderator
Bookmark It
< Previous :
How to declare a property in an Interface?
Next > :
What is the location of Global Assembly Cache on t ...
Comments or Responses
Posted by:
Rajeev.Shukla
on: 11/24/2011 |
Points: 10
You can use
Automatic properties provide by .Net framework 3.0 onwards
as-
[DefaultValue(0)]
public int PersonID
{
get;
set;
}
If get is not required, make it as private. If set is not required make it as private.
Login to post response
More Interview Questions by SheoNarayan
Write code for a html table that will have one row and one column?
What is StringCollection?
What is the full form of URI, URL, URN?
What is XML?
What is Document Type Definition (DTD)?
What is DOM?
What is Data Source Object?
What is complex data types?
Latest Interview Questions
What is the location of Global Assembly Cache on the system.
What's the difference between private and shared assembly?
Can you place two .dll files with the same name in GAC (Global Assembl ...
Can you edit data in Repeater control?
What is DOM?
How to make sure that despite using validation control on your.aspx pa ...
What is typed dataset ?
What is the use of CommandBehavior.CloseConnection?
More ...