Character.isDig it() or Character.isLet ter() in Java.lang work of course, but I had to make my own solution as homework so here they are:
isDigit method:
isLetter method:
Are there any other solutions for this thing and is mine bound to work in every condition?
isDigit method:
Code:
static boolean isDigit(char c) {
return (c <= '9' & c >= '0');
}
Code:
static boolean isLetter(char c) {
return (c <= 'z' & c >= 'a' || c<='Z' & c>='A');
}