Hi
I'm new to
java - can anyone help?
I'm trying to determine if a character is upper case. I must use its own method which I should call in the main. Can anyone spot my obvious mistake?
Thanks
import java.util.*;
public class CharRange {
public static void main (
String[] args){
Scanner keyboard = new Scanner (System.in);
System.out.println("please enter a character to test");
char input = keyboard.nextLine().charAt(0);
System.out.println("You said: " + input);
isCapital(input);
}
public static void isCapital(char example){
char example;
if('a' <= example && example >= 'z')
System.out.println ("This is a lowercase character");
else if('A' <= example && example >= 'Z')
System.out.println("This is an uppercase character");
else
System.out.println("void entry...this is a symbol");
}
}