网站建设公司的政策风险,网钛cms做的网站,东莞详细页设计,软件园我想比较数组中字符串形式的学生人数与人数n这是字符串。remarque#xff1a;班级形成#xff1a;私有字符串代码#xff1b;私有字符串名称#xff1b;private int nbsi 0;私人学生[]标签新学生[200]#xff1b;班级学生#xff1a;私有字符串号#xff1b;私有字符串…我想比较数组中字符串形式的学生人数与人数n这是字符串。remarque班级形成私有字符串代码私有字符串名称private int nbsi 0;私人学生[]标签新学生[200]班级学生私有字符串号私有字符串名称私有字符串name2;public Module []选项卡 new Module [4];块引用类的形成package tp2_bis;public class Formation{//question 2private String code;private String name;private int nbsi0;private Student [] tab new Student[200];//question 3public Formation(String code,String name){this.setCode(code);this.setName(name);}public Formation(){}//question 4public String getCode(){return code;}public void setCode(String code){this.code code;}public String getName(){return name;}public void setName(String name){this.name name;}public int getNbsi(){return nbsi;}public void setNbsi(int nbsi){this.nbsi nbsi;}//question 6_bpublic boolean searchName(String n1){int i0;boolean bfalse;while(!b i{if(tab[i].getName().equals(n1)) //there is the problem i cant compare between them??btrue;elsei;}return b;}}班级班级学生班级组建package tp2_bis;public class Student{//question 2private String number;private String name;private String name2;public Module[] tab new Module[4];//question 3public Student(String name,String name2){this.setName(name);this.setName2(name2);}public Student(){}//question 4public String getNumber(){return number;}public void setNumber(String number){this.number number;}public String getName(){return name;}public void setName(String name){this.name name;}public String getName2(){return name2;}public void setName2(String Name2){this.name2 name2;}public Module[] getTab(){return tab;}public void setTab(Module[] tab){this.tab tab;}//question 5_apublic void addMark(Module m){int i0;boolean bfalse;while(i4 !b){if(this.tab[i]null){this.tab[i]m;btrue;}elsei;}}public void addMark(String name,double mark,int cof){Module mnew Module(name,mark,cof);int i0;boolean bfalse;while(i4 !b){if(this.tab[i]null){this.tab[i]m;btrue;}elsei;}}public void write(){Module[] tab1 this.tab;System.out.println(numero dinscription:this.getNumber()\nNom et Prenom de letudiant: this.getName() this.getName2()\nNotes:);}Blockquote的主要功能package tp2_bis;public class TestFormation{public static void main(String[] args){Formation fnew Formation(CPI_2016,class of computer science);Etudiant e1new Etudiant(ali,djamel);Etudiant e2new Etudiant(karim,rachid);f.inscription(e1);f.inscription(e2);Module m1new Module(algo,19,5);e1.addMark(m1);e1.addMark(analyse,17,5);m1new Module(algebre,20,3);e1.addMark(m1);m1new Module(archi,15,4);e1.addMark(m1);e1.write();e2.addMark(new Module(algo,17,5));e2.addMark(new Module(analyse,18,5));e2.addMark(algebre,20,3);e2.addMark(archi,15,4);e2.write();System.out.println(f.searchName(karim));}}