Hi guys. I'm working on a little program and it uses two classes. One class is already written- it creates a stack of 5 integers and then calls a method to return the largest value in the stack. I'm trying to write this method.
Inside this method I create a listiterator object to iterate through the stack, but when i do iterator.next() for some reason it returns an "object" and not an integer, even though the stack is of type integer and not just object? But it does throw me an error. I dont understand why its returning me just a plain object