
计算机
t = shanchu(emp, 10, 李明); 这一行提示找不到shanchu方法 然后还有 t = search(emp, 10, emp1, 计算机系); 也说找不到search方法 贴一下代码,有没有好心人能帮忙看看是哪里出问题了?谢谢啦! Javaimport Java.io.*;import Java.util.*;class tel { int empno; String empname; String empdept; String empph;}class phone { public static void mAIn(String args) { tel emp, emp1; emp = new tel; emp1 = new tel; int k, t; Scanner sc = new Scanner(System.in); System.out.println(请进行操作选择); while (true) { System.out.println(请选择操作码:0:exit 1:输入 2:输出 3:删除 4:查找!); k = sc.nextInt(); if (k 4 || k 0) { System.out.println(输入操作码有误,请重新输入!); continue; } else { switch (k) { case 0: System.exit(0); break; case 1: shuru(emp, 10); break; case 2: shuchu(emp, 10); break; case 3: t = shanchu(emp, 10, 李明); if (t == 10) System.out.println(没有找到指定条件记录,无法删除); else { System.out.println(删除后结果为:); shuchu(emp, t); } break; case 4: t = search(emp, 10, emp1, 计算机系); if (t == 0) System.out.println(没有找到指定条件记录!); else { System.out.println(找到的记录集合为:); shuchu(emp1, t); } break; } } } } static void shuru(tel x, int y) { BufferedReader buf; buf = new BufferedReader(new InputStreamReader(System.in)); Scanner sc = new Scanner(System.in); try { for (int i = 0; i y; i++) { x = new tel(); System.out.println(请输入第 + (i + 1) + 个员工信息); System.out.print(员工编号:); x.empno = sc.nextInt(); System.out.print(员工姓名:); x.empname = buf.readLine(); System.out.print(员工部门:); x.empdept = buf.readLine(); System.out.print(员工电话号码:); x.empph = buf.readLine(); } } catch (IOException e) { 问题就出在这俩方法: - t = shanchu(emp, 10, 李明); - t = search(emp, 10, emp1, 计算机系); 求大佬帮忙看一下,感激不尽Copyright © 2025 IZhiDa.com All Rights Reserved.
知答 版权所有 粤ICP备2023042255号