Exceptions. Please help

Hi, i’m new to java (which is why im posting it here ). I was just wondering if someone can write me a sample code for exception. Nothing fancy, just a few lines. Lets say ive got my main function and thats doing something. In my main , im asking a user to input their first name (of course, this is string). What i want to do is, if the user has entered in nothing or if they’ve entered in a number (as a person cannot have numbers in their name), then i want an exception just saying that “You have entered a number as your first name, please try again”. Basically, i want my exceptions to be handled in another class completely and i would like them to be triggered when that happens. Could someone help me please? Thanks.