26.02.2015 Views

C#.Net Migration - A2Z Dotnet

C#.Net Migration - A2Z Dotnet

C#.Net Migration - A2Z Dotnet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Properties<br />

public class Human<br />

{<br />

private int m_Age;<br />

public int Age<br />

{<br />

set<br />

{<br />

if (value > 0)<br />

{<br />

m_Age = value;<br />

}<br />

else<br />

{<br />

}<br />

}<br />

A better way of exposing<br />

data members, through a<br />

public property and<br />

private field for storage<br />

throw new ArgumentOutOfRangeException("Age invalid");<br />

}<br />

}<br />

get{return m_Age;}<br />

25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!