So I created a custom linkedlist and while testing it to ensure functionality, I noticed something weird.
When I run this code:
LinkedList<Integer> list = new LinkedList<>();
System.out.println(list.isEmpty());
list.add(13);
list.add(423);
list.add(23);
list.add(022);
list.add(122);
list.add(25);
System.out.println(list.get(1));
System.out.println(list.isEmpty());
for (Integer i: list) {
System.out.println(i);
}
I get this output:
true 423 false 13 423 23 18 122 25
Why is it that 022 got converted into 18?