how to remove a object from linked list in java?

后端 未结 7 907
花落未央
花落未央 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 15:00

    When you do this:

    list.remove(101);

    you are calling this method, which will not serve your purpose.

    You should rather use:

    list.remove(data);

提交回复
热议问题