// 触发菜单 while (true) { System.out.println("请选择操作:"); System.out.println("1.查看所有员工信息\t2.添加员工信息\t3.删除员工信息\t4.修改员工信息\t0.退出"); Scanner input = new Scanner(System.in); int operation = input.nextInt(); switch (operation) { case 1: printAllEmployees(); break; case 2: addEmployee(); break; case 3: deleteEmployee(); break; case 4: updateEmployee(); break; case 0: System.out.println("已退出"); return; default: System.out.println("请输入正确的操作编号"); break; } } }
标签:case,某段,截取,System,员工,break,println,out From: https://www.cnblogs.com/w10225/p/17426548.html