class Demo
{
public int show(char[]arr,char num)
{
for (int i=0;i<arr.length ;i++ )
{
if (num==arr)
return i;
} return -1;//这里是什么意思啊。毕老师在第几天貌似讲 过,但是现在又迷糊啦。去掉不行吗?去掉显示没有返回值,为什么? }
}
class Test
{
public static void main(String[]args)
{
char[]arr={'*','&','%','^','#','%'};
char num='%';
Demo d=new Demo();
System.out.println(d.show(arr,num));
}