JAVA程序设计~宿舍管理系统
import java.io.*;import java.util.*;class Room { String ID; String tpye; int RN;
import java.io.*; import java.util.*; class Room { String ID; String tpye; int RN; Room() { this.RN =6; } void show() { System.out.println("房间的编号:"+this.ID); System.out.println("房间的类型:"+this.tpye); System.out.println("房间的还能够容纳的学生数量:"+this.RN); } } class Student { String name; String ID; String gender; String RoomID; void show()//显示学生信息的方法 { System.out.println("学生的学号:" +this.ID); System.out.println("学生的姓名:" +this.name); System.out.println("学生的性别:" +this.gender); System.out.println("学生的房间号:" +this.RoomID); } static void showallstudent(ArrayList allarraylist)//创建一个显示所有学生的 信息的方法 { for(int i= 0; i<allarraylist.size();i++) { System.out.println(); System.out.println("第" +(i +1) +"名学生:"); Student allstudent =(Student)allarraylist.get(i); System.out.println("学生的学号:" +allstudent.ID); System.out.println("学生的姓名:" +allstudent.name); System.out.println("学生的性别:" +allstudent.gender); System.out.println("学生的房间号:" +allstudent.RoomID); System.out.println();

