Introduction to OOP Chapter 4: Classes and Methods: next previous audio real text

Properties in C#


public class PlayingCard {
	public int rank {
		get 
		{
			return rankValue;
		}
		set 
		{
			rankValue = value;
		}
	}
	...
	private int rankValue;
}

Omitting a set makes it read-only, omitting a get makes it write-only.
Intro OOP, Chapter 4, Slide 30