C# why this snippet valid? Could anyone explain what are they and how to use?
<pre><code>private bool duplicate;
public bool duplicateNumber
{
    get
    {
        return duplicate;
    }
    set
    {
        duplicate = value;
    }
}
</code></pre>

<p>What does this snippet mean?
How to use it? I am new on c# and know java only.
the variable <code>value</code> doesn't need to be declared seems...</p>

<p>Why don't just make a getter or setter for a private variable?</p>
