bug in java.util.LinkedList
From: HB (HB_at_discussions.microsoft.com)
Date: 01/05/05
- Previous message: Diganta Roy[MSFT]: "RE: convert bmp to jpeg"
- Next in thread: Lars-Inge Tønnessen [VJ# MVP]: "Re: bug in java.util.LinkedList"
- Reply: Lars-Inge Tønnessen [VJ# MVP]: "Re: bug in java.util.LinkedList"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 5 Jan 2005 03:35:05 -0800
I think there is a bug in the J# implementation of java.util.LinkedList:
package Test;
import java.util.*;
public class Class1
{
public static void main(String[] args)
{
LinkedList queue = new LinkedList();
queue.addLast("a");
queue.addLast("b");
queue.addLast("c");
displayQueue(queue); // diplays a, b, c
queue.remove("b");
displayQueue(queue); // displays b, c !!!!!! should be a, c
}
private static void displayQueue(LinkedList queue)
{
for (int i=0; i<queue.size(); i++)
System.out.println(queue.get(i).toString());
System.out.println();
}
}
Comments please ! ...
- Previous message: Diganta Roy[MSFT]: "RE: convert bmp to jpeg"
- Next in thread: Lars-Inge Tønnessen [VJ# MVP]: "Re: bug in java.util.LinkedList"
- Reply: Lars-Inge Tønnessen [VJ# MVP]: "Re: bug in java.util.LinkedList"
- Messages sorted by: [ date ] [ thread ]