Hi,
I am new to java and need help to understand following behavior I tried today.
I have a class variable defined like:
private static LinkedList<Integer> queue = new LinkedList<Integer>();
In Constructor I am adding some elemets as following:
Queue(){
for(int i=0;i<10;i++){
queue.add(i);
}
}
While in main its shows LinkedList as empty. So my question is why adding elements in constructor is not working for me.
Thanks in advance