Write a program in java for a user defined exception named as Illegal Age Exception. If the age entered by the user is less than 18 or greater than 60, then the program should raise a user defined exception which is explicitly handled by the code.

That is a nice assignment to learn to work with Exceptions.
Thank you for sharing it with the community.

If, however, your point was to attempt to convince us to write it for you, I'm afraid you will be dissapointed. Do take a look at the community rules which you accepted on registering on Daniweb.

Under "Keep it Organized" you find this:

Do provide evidence of having done some work yourself if posting questions from school or work assignments

We will not do your homework for you. We will, however, help you understand and correct your code if something goes wrong, once you posted the code you've written and told us exactly what is failing.

commented: Nicely put! +13
commented: I could't have put it better myself. +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.