小编Jav*_*018的帖子

使用其唯一ID删除ArrayList的对象

我在的功能方面遇到问题ArrayList。我正在尝试通过指定ArrayList的对象来删除它们IDcreateEmployeeMain班上有一个方法:

public void createEmployee(){
    String typeofemployee = sc.nextLine();

    UUID uniqueID = UUID.randomUUID();
    String x = "" + uniqueID;
    System.out.println("The new ID of the " + typeofemployee + " is: " + uniqueID + ".");

    System.out.println("What's the name of the new " + typeofemployee + "?");
    name = sc.nextLine();
    System.out.println("What's the salary of the new " + typeofemployee + "?");
    salary = sc.nextDouble();
    Employee employee = new Employee(x, name, salary);

    switch (typeofemployee) { …
Run Code Online (Sandbox Code Playgroud)

java arraylist

2
推荐指数
2
解决办法
2052
查看次数

标签 统计

arraylist ×1

java ×1