People of stackoverflow. I am new to c# and this is the first time I have not been able to find an answer to one of my elementary questions. Who can help me?!I am trying to
In this case instead of generating a new variable like the rest of the answers are saying. You can simply just write.
public string Headline { get; set;}
This will allow anyone to retrieve this variable which you could re write as
public string Headline;
If you want the setting to be private you can say.
public string Headline { get; private set; }
I like it this way better because this way you don't have to allocate a new variable and the readability of the code greatly increases :)