定义如下:老是提示类型不兼容,为什么呢??
class Text
{
public static void main(String []args)
{

String str="ying";
String []temp=new String[3];
temp[0]="cheng";
temp[1]="ying";
temp[2]="woshi";
for(int i=0;i<3;i++)
{
if(str.compareTo(temp[i]))
System.out.print(i);
}