ulvis.paste.net

Paste Search Dynamic
Recent pastes
graphLists
  1. public static void main(string[] args){
  2.     List<List<Graph<?>>> graphLists=new ArrayList<>();
  3.     List<Graph<Integer>> graphList1=new ArrayList<>();
  4.     List<Graph<String>> graphList2=new ArrayList<>();
  5.     graphLists.add(graphlist1); //Compiler error
  6.     graphLists.add(graphlist2); //Compiler error
  7.  
  8.     for(List<Graph<?>> graphList : graphLists){
  9.         for(Graph<?> graph : graphList){
  10.             //Do something graph specific
  11.             system.out.println(graph.getNodes());
  12.         }
  13.     }
  14. }
  15.  
Parsed in 0.012 seconds