Q:

What is the difference between String and string in C#?

0

What is the difference between String and string in C#?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Many C# programmers ask is: “What is the difference between string and String?” Basically string is an alias in C# for System.String. So technically, there is no difference.

In simple words, “string” is a datatype, whereas “String” represents a class. As far as guidelines, it’s generally recommended to use string any time you’re referring to an object.

There is another small difference is that if you use the String class, you need to import the System namespace on top of your file, whereas you don’t have to do this when using the string keyword.

Example,

string name= "aticleworld";

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# Interview Questions and Answers,You Need To Know

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is function overloading in c#?... >>
<< What is the major use of ‘using’ keyword in c#...