Property Example C# with Example



Property Example C# with Example

 	using System;

	namespace CSharpClass{
		class PropertyClass
		{
			private int TheRealValue; 		// Field: memory allocated
			public int MyValue 				// Property: no memory allocated
			{
				set
				{
					TheRealValue = value;
				}
				get
				{
					return TheRealValue;
				}
			}
		}
	}
 

0 Comment's

Comment Form

Submit Comment