HOME RESOURCES PLACEMENTS CONTACT FEEDBACK SUBSCRIBE


QUICK LINKS .NET Articles
.NET Training Tutorial
HR Interview Questions
.NET Interview Questions
SQL Interview Questions
JAVA Interview Questions

Here you can find a list of C# "Difference Between" questions which are asked most of the time in your interviews.
For a list of all other type of questions Click Here
What is the difference between value types and reference types?
Difference between value types and reference types
  • Value Types are stored on the stack where as reference types are stored on the heap.
  • Variables of the value types directly contain their data, where as variables of the reference types store references to objects.
  • With reference types, it is possible for two variables to reference the same object, and thus possible for operations on one variable to affect the object referenced by the other variable. With value types, the variables each have their own copy of the data, and it is not possible for operations on one to affect the other.
  • Value types include simple types (e.g., char, int, and float), enum types, and struct types. Reference types include class types, interface types, delegate types, and array types.
What is the difference between a read only property and write only property?
Readonly property will have only the get accessor, where as write only property will have only the set accessor

What is the difference between a static property and a non static(instance property) property?
When a property declaration includes a static modifier, the property is said to be a static property. When no static modifier is present, the property is said to be a non static property(instance property).

A static property is not associated with a specific instance, and it is a compile-time error to invoke a static property on an instance(object) of a class. On the other hand non static properties also called as instance properties can be invoked only on an instance of a class and not on the name of the class.

What is the difference between strings of type System.String and System.Text.StringBuilder?
Difference between strings of type System.String and System.Text.StringBuilder
  • Strings of type System.String are immutable, where as Strings of type System.Text.StringBuilder are mutable.
  • As Strings of type System.String are immutable performance could be negatively impacted in applications where we have intense string manipulations. It is a good practice to use Strings of type System.Text.StringBuilder in applications involving intense string manipulations.
What is the difference between a while loop and a do..while loop?
Difference between a while loop and a do..while loop
  • Do..while loop checks its condition at the end of the loop where as while loop checks the condition first and then execute the statements with in the loop.
  • Do..while loop is guaranteed to execute at least one time where as while loop is not.
What is the difference between a for loop and a foreach loop?
Difference between a for loop and a foreach loop
  • foreach loop is extremely useful when you dont know how many times do you exactly have to loop thru, on the other hand you can use for loop only if you know how many times do you have to loop thru before hand.


C# most frequently asked Interview questions. FAQS 10/17/2008 9:31:25 AM - By Satheesh.S

these notes are very useful for .net learner. i need the details of the .net course and course fees. please send me through mail.

Thanks.



Your Questions/Comments/Feedback:
If you have some questions that needs an answer you can post them here. If you find this page useful please post your comments and feedback.
Title/Question:
Name:
Email:
Comments: