|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- public class HouseView {
- private boolean loop = true;
- private char key = ' ';
- private HouseService houseService = new HouseService(10);// 因为要调用list所以要新建HouseService对象
- //显示房屋列表
- public void listHouses() {
- System.out.println("============房屋列表============");
- System.out.println("编号\t\t主\t\t 电话\t\t 地址\t\t 月租\t\t 状态(未出租/已出租)");
- House[] houses = houseService.list();
- for (int i = 0; i < houses.length; i++) {
- if (houses[i] != null) {
- System.out.println(houses[i]);
- }
- System.out.println("============房屋列表显示完毕============");
- }
- }
- public void mainMenu() {
- do {
- System.out.println("--------------房屋出租系统-----------");
- System.out.println("\t\t\t\t1 新 增 房 源");
- System.out.println("\t\t\t\t2 查 找 房 屋");
- System.out.println("\t\t\t\t3 删 除 房 屋");
- System.out.println("\t\t\t\t4 修 改 房 屋 信 息");
- System.out.println("\t\t\t\t5 房 屋 列 表");
- System.out.println("\t\t\t\t6 退 出");
- System.out.println("请输入你的选择(1-6)");
- key = Utility.readChar();
- switch (key) {
- case '1':
- System.out.println("d4as6d46a4d");
- break;
- case '2':
- System.out.println(" dsadasd");
- break;
- case '3':
- System.out.println(" dasdasd");
- break;
- case '4':
- System.out.println(" a");
- break;
- case '5':
- listHouses();
- break;
- case '6':
- loop = false;
- }
- } while (loop);
- }
- }
复制代码
其他那些包是完善功能的,不用管,我现在就是不知道这个switch错在哪里了 我输入除了6以外能成功,输入1-5都会都行循环回页面 |
|