Find jobs | Jobseekers
Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Career Services Resume Services Interview questions Articles Books
Content
NET framework
NET assembly
NET code security
NET access modifiers
NET architecture
NET base class library
NET CLR
NET constants,enum,arrays
NET data types
NET menu
NET garbage collection
NET debug and trace
NET properties
NET form
NET assemblies & resources
NET class & structures
NET binding,viewing,filtering
NET configuring & optimizing
NET configuring setup project
NET constructors & destructors
NET control
NET dataset objects
NET debugging tools
NET debug & trace classes
NET delegates & events
NET exception handling
NET globalization-localization
NET interoperability
NET project deployment
NET securing application
NET using XML
NET validating user input
NET windows communication
NET windows presentation
NET windows workflow
 
ASP.NET
C#.NET
VB.NET
AJAX
 
PHP
 
C
C++
Java
Data Structure
Oops
 
Database concepts
SQL Server
Oracle
MySQL
Data warehousing
Service-oriented architecture
SQL Server notification services
SQL Server Reporting Services
Sharepoint
Biztalk interview questions
 
Operating System
Project Management
Linux
Testing
Networking
Software engineering
 
UML
XML
HTML
SOAP
CSS
VBScript
 
CV tips
Cover letter tips
Interview tips
Human resources
Soft skills
Group discussion

.NET properties


.NET properties - Interview questions

<<Previous  Next>>

.NET Properties - August 29, 2008 at 15:00 PM by Amit Satpute

Explain how to implement properties.

You can either use fields or property procedure to add properties.

It is convenient to use fields when the values associated with the properties are less in number. eg: boolean which can have only two values associated with it.

If property procedure has to be used to add a property, then three steps need to be followed:

- Declare a private variable to store the value of the property
- Write a get procedure to retrieve the value of the variable and
- Write a set procedure to set the value of the variable.

Explain how to create a read-only or write-only property.

You can either use fields or property procedure to add properties.

To create a property that can only be read and not altered, you need to decalre it as ReadOnly. After doing this, if you try to assign value to the property, an error will occur.
The next step is to write a get procedure to retrieve the value contained by the variable.
Nb: The set procedure should not be written in this case.

To create a WriteOnly property like in case of passwords, you need to declare it as WriteOnly. Then, this value cannot be used for reading purposes. After the declaration, you need to write only a set procedure without writing a get to be able to just set the value of the variable.


<<Previous  Next>>

 



 
Today's Hot Jobs
C++  SQL Server
.NET  Java  Oracle
Finance  Marketing
Seekers  Employers
Copyright © 2008 CareerRide.com. All rights reserved.