Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean NumbersOnly()
- {
- // Variables
- String Year;
- String Amount;
- char Yearchar;
- char Amountchar;
- for (int i = 0; i < Year.length() ; i++)
- {
- if (Character.isDigit(Yearchar))
- { System.out.println(Yearchar + " is numeric.");
- return true;
- } else if (Character.isLetter(Yearchar))
- { System.out.println(Yearchar + " is a letter.");
- return false;
- }
- }
- } //end of NumbersOnly method
Add Comment
Please, Sign In to add comment