Posted By

cetnar on 07/15/06


Tagged

generics tiger wildcard


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

xaviaracil


Generics - Using Type Wildcards


 / Published in: Java
 

Uwaga: taki typ generyczny jest niestety readonly.

  1. public void printList(List<?> list, PrintStream out) throws IOException {
  2.  
  3. for (Iterator<?> i = list.iterator( ); i.hasNext( ); ) {
  4.  
  5. out.println(i.next( ).toString( ));
  6.  
  7. }
  8.  
  9. }

Report this snippet  

You need to login to post a comment.