Create a class Doctor with attributes id, name, age and department. Initialize values through
parameterized constructor. If age of Doctor is not in between 25 and 65 then generate user-defined
exception “AgeNotWithinRangeException”. If name contains numbers or special symbols raise exception
“NameNotValidException”.
1 Answer