Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package zwei;
  2.  
  3. import java.util.HashMap;
  4.  
  5.  
  6.  
  7. public class bla {
  8.  
  9.        
  10.         static HashMap<Integer, String> kopie = new HashMap<Integer, String>();
  11.         static HashMap<Integer, String> zwo = new HashMap<Integer, String>();
  12.  
  13.         public bla(HashMap<Integer, String> zwo){
  14.  
  15.                 for(Integer single : zwo.keySet()){
  16.                         kopie.put(single, zwo.get(single));
  17.                 }
  18.         }
  19.        
  20.        
  21.         public static void main(String[] args) {
  22.                 for(int i=0 ; i<10 ; i++){
  23.                         //Animal p = new Animal(wurstkopf);
  24.                         zwo.put(i, "wurstkopf"+i);
  25.                 }
  26.  
  27.                 bla abc = new bla(zwo);
  28.                
  29.  
  30.                 for(Integer single : kopie.keySet()){          
  31.                         System.out.println(single);
  32.                         System.out.println(kopie.get(single));
  33.                        
  34.                 }
  35.  
  36.         }
  37.  
  38. }