Generic type in Java [duplicate]

This question already has an answer here:

What is a raw type and why shouldn't we use it?

14 answers

I'm trying to make an implementation of the Java queue class but I have some problems.

I want the class to implement the following interface:

public interface iQueue {

public void add(E e);


public class Queue implements iQueue{

Element first;


public void add(E e) {

Element node = new Element();




The compiler indicates that the add method parameter must be of type Object to implement the interface

If I declare the parameter of type Object, is the type E declared when...

Read More »

By: StackOverFlow - Tuesday, 13 March

Related Posts