Quantcast
Channel: BlogoSfera » ES
Viewing all articles
Browse latest Browse all 137

Combinig two generic List

$
0
0

I want to union two generic list and want to produce new list , I am providing my code in a simple format. public class Example{ public static <E> List<E> union(List<? extends E> a,List<? extends E> b){ List<Object> es= new ArrayList<Object>(); for( E e:a){ es.add(e); } for( E e:b){ es.add(e); } return (List<E>) es; } [...]

The post Combinig two generic List appeared first on BlogoSfera.


Viewing all articles
Browse latest Browse all 137

Trending Articles