What is difference between string keyword and String Class. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 ?

26th Oct 2017, 2:12 PM
Muhammad Saleem Kalro
Muhammad Saleem Kalro - avatar
2 Respostas
+ 1
There's no difference
26th Oct 2017, 2:46 PM
Slifer
Slifer - avatar
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ā€ )
14th Nov 2017, 7:05 AM
Khalil Shakir
Khalil Shakir - avatar