Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Driver{
- public static void main(String[] args){new Driver();}
- public Driver(){
- int month = -1;
- do{
- try{
- month = Utility.queryForInt("Enter a number between 1-12: ");
- }catch(IllegalArgumentException ex){
- System.out.println("That is not a valid number!");
- }
- }while(month<1 || month>12);
- System.out.println("Month: "+Date.getMonthName(month));
- System.out.println("Short: "+Date.getMonthShort(month));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement