Error handling in property setter validating

image_pdfimage_print
   
 


using System;

public class Employee {
    private int prop_age;
    public int age {
        set {
            if (value < 0 || value > 120) {
                throw new ApplicationException("Not valid age!");
            }
            prop_age = value;
        }
        get {
            return prop_age;
        }
    }
}