I'm trying something that should be a simple case of polymorphism. I have a method that returns an object of type ArrayList and am trying to assign an object of type List to the return value of said method. Here's the code:
List<Object> inorder = parser.parseInorder();
Where I have a parser object to parse an incoming file, and the parseInorder() method returns an
ArrayList<Integer>.
Eclipse is giving me this error:
Type mismatch: cannot convert from ArrayList<Integer> to List<Object>