Using object identifier as variable name
<p>Just wondering ...</p>

<p>Playing around with C++, I found that if you create a class called <code>circle</code>, and then declare a variable named exactly as the name of the class, the compiler does not complain. For example:</p>

<pre><code>class circle {
  // whatever it does in here
};

circle circle;   // is a valid statement, but
circle *circle = new circle();  // gives you a 'circle' is not a type complain
</code></pre>

<p>It turns out that this goes for string string = "string"; as well. And tried it with Java, possible also. I guess it might work on C# too, but I haven't tried.</p>

<p>Can anyone tell me the reason behind this and whether this is an intentional feature?</p>
