小编KIN*_*HAI的帖子

Collection对象无法显示在java,Arraylist,Collection中显示某些未定义值的输出

当我尝试打印一个集合对象时,它会打印出来Employee@122392Iie92.为什么打印这个而不是员工列表的详细信息?

我的代码:

    public class Employee {

    private String name;
    private String designation;
    private int employeeId;
    private int salary;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getDesignation() {
        return designation;
    }
    public void setDesignation(String designation) {
        this.designation = designation;
    }
    public int getEmployeeId() {
        return employeeId;
    }
    public void setEmployeeId(int employeeId) {
        this.employeeId = employeeId;
    }
    public int getSalary() {
        return salary;
    }
    public void setSalary(int salary) { …
Run Code Online (Sandbox Code Playgroud)

java collections arraylist

3
推荐指数
1
解决办法
92
查看次数

标签 统计

arraylist ×1

collections ×1

java ×1