I was having problems with incompatible types on a
string to be read. I want to read a string and each letter be printed on a seperate line...right now I am working on this line....
here is the error when compiling.
A:\Chapter 3\Bench\StringRead.java:22: incompatible types
found : char
required: java.lang.String
place = Character.toLowerCase(sentence.charAt(i));
^
1 error
Tool completed with exit code 1
I understand the basics of objects, but I am still working on how to use the api right. Could anyone point me out to a tutorial that would help me? Thank you very much. Here is the entirety of the program still in progress....
import cs1.Keyboard;
public class StringRead
{
public static void main (String[] args)
{
String num, place, sentence;
int i , letter;
System.out.println ("Please put in a string of letters or a sentence...");
sentence = Keyboard.readString();
for (i = 0; i < sentence.length();++ i)
{
place = Character.toLowerCase(sentence.charAt(i));
}
}
}
Thanks again for your help and time....
-Calv1n