怎么就差这么一点点?
各位帮一下忙,看有什么问题?
import java.io.*;
public class enterchar
{ public static void main(String args[])
{ char n;
char arr[3]={B,C,E};
n=getcha();
while(compare(arr[3],n)==0)
{ n=getcha();
}
}
public static char getcha()
{ char s;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the destination:");
s=br.readLine();
s.toUpperCase();
return s;
}
public static void compare(char a[],char c)
{ char c;
char a[];
boolean flag=0;
for(int i=0;i<a.length;i++)
if(c==a[i])
{ System.out.println(c);
flag=1;
break;
}
return flag;
}
}