Question: How would you write code for an integer property called Age with a getter and setter?

  1. public int Age { get - set }
  2. public int Age: get set;
  3. public int Age (get, set );
  4. public int Age { get; set; }

Answer: The correct answer of the above question is Option D:public int Age { get; set; }