I have an interface below:
/**
* <T> Time format. Can be long, date etc
*/
public interface TimeStamp<T> extends Comparable<TimeStamp<T>>
{
/**
* Returns the timestamp.
* @return
*/
public T getTimeStamp();
}
Now I want to have a list, that will hold TimeStamp and have some methods whose behavior will depend upon the timeStamps it holds.
public class TimeList<TimeStamp<T>> extends ArrayList<TimeStamp<T>>
{
......
}
The compiler shows error with the above statement. What is wrong with it?
In the class definition you can only specify the generic type alone, try: