What does <> do in Java -


i new working java. far have been able use basic such classes, functions, arrays etc knowledge of javascript , php.

however, have never seen before this: <>. inside of variable of type. because don't know called, can't find answers.

i've seen them this:

list<string> mylist = new arraylist<string>(); 

but like:

public static <t> boolean contains( final t[] array, final t v ) {     ( final t e : array )         if ( e == v || v != null && v.equals( e ) )             return true;      return false; } 

what <string> mean? in function, wondering special t?

this generic type

what allows pass through type, , make useful multiple object types

so list generic collection, , allows make list of object. making list<string> make object list of strings. or use list<myclasstype> , make list of objects of class


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -