Hi,
i'm programming for the first time in .NET (C#)
I was wondering, what is the good solution to write getters en setters?
Is this:
orCode:public void getVar(){ return m_var; } public String setVar(String newVar){ m_var = newVar; }
or are both solutions correct?Code:public String var { get { return m_var; } set { m_var = value; } }
And if there is only one solution, can you explain why i can't use the other one?
tnx



Reply With Quote

Bookmarks