主题:帮忙看看程序
package COURSE;
public class COURSE{
int c_number=0;
String name[]={" "," "," "," "," "," "};
void SET(String name,String s){
if (c_number>=5) {
System.out.println("这个课程人数已经满了!!");
return;
}
this.name[c_number]=name;
c_number++;
}
void MAKESURE(String name)
{
for(int i=0;i<=c_number;i++)
{
if(name==this.name[i]){System.out.println("选择成功!"); return;}
}
System.out.println("你没选择这个课程!");
}
}
定义一个叫做COURSE的类其中有方法,为什么出现2个错误: 'class' or 'interface' excepted ?
public class COURSE{
int c_number=0;
String name[]={" "," "," "," "," "," "};
void SET(String name,String s){
if (c_number>=5) {
System.out.println("这个课程人数已经满了!!");
return;
}
this.name[c_number]=name;
c_number++;
}
void MAKESURE(String name)
{
for(int i=0;i<=c_number;i++)
{
if(name==this.name[i]){System.out.println("选择成功!"); return;}
}
System.out.println("你没选择这个课程!");
}
}
定义一个叫做COURSE的类其中有方法,为什么出现2个错误: 'class' or 'interface' excepted ?