how to remove a object from linked list in java?

后端 未结 7 887
花落未央
花落未央 2020-12-15 14:08

i have one problem with my code ,i did a sample program to display the emp details from a linked list,now the problem when i trying to delete a particular entry means it doe

7条回答
  •  自闭症患者
    2020-12-15 14:59

    You try to delete element with index 101, but you have only 4 items in list. How it can delete element with index 101?

    If you want to delete element that is equals to EmpDedup(101,"entry1",20) than you have to pass in remove method this object. And don't foget to redefine equals and hash code of EmpDedup.

提交回复
热议问题