What is the difference between null and string empty in c#?



What is the difference between null and string empty in c#?..

Answer / Kapil

In C#, a string that contains no characters (i.e., an empty string) is represented by two consecutive quotes: "". On the other hand, null represents a variable or object that has not been assigned a value. These are distinct and should not be treated as equivalent.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is an extension method in c#?

1 Answers  


How do I create a dbml file?

1 Answers  


How can encapsulation be achieved?

1 Answers  


Why is static constructor called first?

1 Answers  


How To Maintain Transaction In C#?

1 Answers   Phoenix Technologies,


What are controls in c#?

1 Answers  


what is meant inheritance. can you exaplain what kind inhertance ussed in your project

1 Answers  


What is object type in c#?

1 Answers  


I created a class which is inherited from interface IDisposable. Now if I use object of this class with using keyword. Then How the dispose method will get call. Does garbage collector call it or some else.

2 Answers   Sapient,


How we convert private assembly into public assembly?

1 Answers   Wipro,


How to assign default value to nullable types? Did nested nullable types are allowed

2 Answers   TCS,


How do I move from one form to another in c#?

1 Answers  


Categories