View RSS Feed

My Java Tips

LinkedList (Generics)

Rating: 1 votes, 1.00 average.
by , 11-03-2011 at 01:07 PM (1489 Views)
Like Vectors and ArrayLists, LinkedList can also be made to deal with only one type of objects. Lets see how to do that.

Java Code:
LinkedList ll = new LinkedList();
The LinkedList named ll can only store String objects. This is very useful and provides more control over collection. You are always sure that you will get objects of a specific type from the list.

Submit "LinkedList (Generics)" to Facebook Submit "LinkedList (Generics)" to Digg Submit "LinkedList (Generics)" to Submit "LinkedList (Generics)" to StumbleUpon Submit "LinkedList (Generics)" to Google

Tags: None Add / Edit Tags
Java SE