题目内容
(1-1)请阅读程序,根据提示补全程序空白处,使程序能够正确运行。classPerson{privateStringname;publicPerson(Stringname){this.name=name;}publicStringtoString(){return"姓名:"+this.name;}}classGeneral<①,②>{privateTvar1;privateVvar2;publicGeneral(Tvar1,Vvar2){this.var1=var1;this.var2=var2;}public③getVar1(){returnvar1;}public④getVar2(){returnvar2;}}publicclassDemo{publicstaticvoidmain(Stringargs[]){General<⑤,⑥>g1=newGeneral("学号:1001,",newPerson("孙悟空"));System.out.println(g1.getVar1()+g1.getVar2());}}
查看答案
搜索结果不匹配?点我反馈