I faced a strange confusion today. Although I read the difference between String and string in C# in this post : What is the difference between String and string in C#?. But when I try to use String
with capital letter without using the namespace System
, it was not recognized. Like
This code works,
using System;
String s = "";
But without using System
, it gives error.
Whereas string
with small letter works with and without using the System
namespace.
If String and string are same things then why one works only with its namespace and other works with and without namespace as well.