Java Generics always for collections -
Java Generics always for collections -
i have question java generics. if define class this:
public test<string> ...
does mean class acts collection type strings? illustration when seeing list know list of strings. <> mean it's collection (general meaning, not actual collection type)?
thanks,
no. means type parameterized type string. there plenty of non-collection generic types. see callable<t>
, future<t>
, comparator<t>
example.
java generics
Comments
Post a Comment