the following code has compilation error in the line of t3:
public List getList()
{
return new ArrayList();
}
public vo
You are calling a generics method from generics method. You need to pass the generics argument from the first method to the getList method.
List list = this.getList();
and
T t3 = this.getList().get(0);
From these two the first compiles also without giving the generics argument because the compiler can get the type from the type of list (from the left side of the assignment). In the second case it isn't a direct assignment and so the compiler does not know the type for the getList() call.
These may behave differently with different compilers.