+ 3
What is difference between string keyword and String Class.
What is difference between string keyword and String Class while using in C#. Which is useful and where ?
2 Antworten
+ 1
There's no difference
0
Side note on that, if you save the same string to two variables, the string object will point to the same reference.
String var1= “hi”
String var2=“hi”
But if you use the new keyword, you’ll have two separate objects pointing to two separate references.
String var1 = “hi”
Sting var2 = new String (“hi” )