Guest User

iki boyutlu kume

a guest
Feb 24th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package cglcgl;
  6.  
  7. import java.util.HashMap;
  8.  
  9. /**
  10.  
  11.  @author cagri.celebi
  12.  */
  13. public class Deneme {
  14.  
  15.     public static void main(String[] args) {
  16.         System.out.println("*** start ***");
  17.        
  18.         try {
  19.            
  20.             HashMap<Integer, HashMap<Integer, String>> haritaTutucu =
  21.                     new HashMap<Integer,HashMap<Integer, String>>();
  22.            
  23.             HashMap<Integer, String> tmpMap1 = new HashMap<Integer,String>();
  24.             tmpMap1.put(1, "ayse");
  25.             tmpMap1.put(2, "fatma");
  26.            
  27.             HashMap<Integer, String> tmpMap2 = new HashMap<Integer,String>();
  28.             tmpMap2.put(1, "ahmet");
  29.             tmpMap2.put(2, "mehmet");
  30.             tmpMap2.put(3, "murat");
  31.            
  32.             haritaTutucu.put(1, tmpMap1);
  33.             haritaTutucu.put(2, tmpMap2);
  34.            
  35.             System.out.println("2'nin 2'si : " + haritaTutucu.get(2).get(2)); // mehmet döner.
  36.            
  37.         } catch (Exception e) {
  38.             e.printStackTrace();
  39.         }
  40.        
  41.         System.out.println("***  end  ***");
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment