classstudent{stringnamedoublescorestringnumstudent(stringn,doubles,stringm){name=n,s=scorenum=m}publicstaticvoidprintinfo(){系統(tǒng)輸出打印(num“,”name“,”score)}}下一步,我們?yōu)檫@個類創(chuàng)建一個數(shù)組://1studentstu[]ltspanstyle=“白色-空間:預(yù)“></span>//聲明數(shù)組。stu=新學生[3]<spanstyle=“白色-空間:預(yù)“></span>//創(chuàng)建數(shù)組。這是一個創(chuàng)建的引用數(shù)組。每個引用都沒有確切的地址。對于(inti=0i<3i){<spanstyle=“白色-空間:預(yù)></span>//為數(shù)組創(chuàng)建一個對象,即將創(chuàng)建的引用與確切的地址相關(guān)聯(lián)。stu[i]=newStudent()}//2Studentstu[]=newStudent[3]for(inti=0i<3i){stu[i]=newStudent()}//3Studentstu[]=newStudent{newStudent(sjl,87,01),newStudent(ljs,98,02),newStudent(lls,92,03)}