I keep getting a symbol not found error when i already defined the symbol please help!
I am currently working hard on writing this project i have for my java programming class. I have written almost all of the code but i am stuck while complieing it in its current form. I keep getting Java error: Cannot find symbol for the line of code i have underlined. well it says [U] next to the line. its not really underlined.
In this project i'm trying to get it to tell me if each character of a string is lower case, upper case or not a letter.
Please help me I have no idea how to correct this error. Thank you!
public class LetterCase
public static boolean isThisSpace(char sentence)
return sentence ==(' ');
public static boolean isThisUpperCase(char sentence)
return (sentence>= 'A' &&sentence <= 'Z');
public static boolean isThisLowerCase(char sentence)
return (sentence>= 'a' && sentence <= 'z');
public static void main(String args)
Scanner keyboard_input = new Scanner(System.in);
System.out.print("Please enter a sentence : ");
String sentence = keyboard_input.nextLine();
int length = sentence.length();
for(int i=0; i < length; i++)
char sentences = sentence.charAt(i);
System.out.println(sentence.charAt(i)+ ":" + "Upper Case");
Re: I keep getting a symbol not found error when i already defined the symbol please help!
sentence is declared as a String and String does not have a isThisUpperCase() method.
"Cannot find symbol" is the Java compiler's way of reporting when it doesn't know about a variable or a method. Common causes are typos or getting a method name (or arguments) wrong.
The String methods that you can validly use with sentence are all in the API docs. If you intend to call the isThisUpperCase() method of your LetterCase class then drop the sentence-dot business and say
but notice that this method wants a char argument, not a String.