In C# we can write
Int a=new int();
char a=new Char();
person p=new person();
where person is a Class.
So why can't we write
string s =new string();
After all string is a reference type. Then why it's not possible?
You can not write it because string has not Constructor taking 0 parameters.
Instead you can write something like this:
String a = new string(new char[]{});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With