Reputation: 4917
I am getting back into java after a few yrs with .NET and I am confused about the following syntax. What exactly is this method expected to return in plain english? I thought it might be a List instance composed of CategoryProxy objects. But this is not correct. Can anyone explain what exactly it returns?
@Override
public Request<List<CategoryProxy>> queryCategorys() {
// TODO Auto-generated method stub
return null;
}
Upvotes: 1
Views: 75
Reputation: 272657
It returns a Request<List<CategoryProxy>>
. In other words, it returns a Request<T>
where T
is parameterised as List<CategoryProxy>
. I can't tell you any more than that without knowing more about what a Request<T>
or a CategoryProxy
is.
Upvotes: 1
Reputation: 97835
It's a Request
parameterized with List
, which is itself parameterized with CategoryProxy
(google "generics").
The meaning of the parameter depends on the parameterized class. For instance, for List
is means the type they can hold, but it can mean other things. The important point is that if a class is parameterized with a certain type, it can constrain method return and parameter types and types of fields with the parameter type.
Upvotes: 2