-1

I am recreating basic data structures as an assignment. I have an interface called Queue and I have to implement the same data structure with the same name (both are in different packages) I tried doing something like this but it gives a warning

Queue is a raw type. References to generic type Queue<E> should be parameterized

This is my code

public class Queue implements uo.mp2021.util.collections.Queue
RMLewis
  • 27
  • 5

1 Answers1

1

What's it a Queue of?

Anything?

public class Queue<E> implements uo.mp2021.util.collections.Queue<E>

Something?

public class Queue implements uo.mp2021.util.collections.Queue<Something>

The point is that the interface is generic, so you need to decide whether you're providing a generic implementation, or a specific implementation.

iggy
  • 1,328
  • 4
  • 3