incompatible types *** have to convert String into char sequence
807599Feb 3 2007 — edited Feb 3 2007The problem is i cant convert the string to char sequence using subSequence() .... I get the following error ... give me the solution ..
public class StrToChar
{
public static void main(String args[])
{
String str = args[0];
int slength = args[0].length();
char c[]=new char[slength];
for(int i=0;i<slength;i++)
{
c=str.subSequence(i,i+1);
System.out.println(c[i]);
}
} }
The error is ...
StrToChar.java:14: incompatible types
found : java.lang.CharSequence
required: char
c[i]=str.subSequence(i,i+1);