0

I am trying to add elements to a Queue using a for-loop

for(int i = 1; i <= cars.size(); i++){
    cars.add(new vehicle(String.valueOf(i));
}

When I try to peek at the queue, I am getting hashcode representations instead of the actual value of i. How can I get the values of i?

Schrode
  • 39
  • 4

0 Answers0