Aujourd'hui :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6void swap(List<String> list, int i, int j) { String s1 = list.get(i); list.set(i, list.get(j)); list.set(j, s1); }Demain :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7
8
9
10Map<Input,Output> cache = …; Output cachedComputation(Input in) { Output out = cache.get(in); if (out == null) { out = computation(input); cache.put(in, out); } return out; }
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6void swap(List<String> list, int i, int j) { String s1 = list[i]; list[i] = list[j]; list[j] = s1; }
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7
8
9
10Map<Input,Output> cache = …; Output cachedComputation(Input in) { Output out = cache[in]; if (out == null) { out = computation(input); cache[in] = out; } return out; }

 

 
		
		 
        

 
			
			

 
  
  
 
 
 
 
   


 JDK 7: Proposition 9 : Notation de tableau pour List et Map -> Intégrée
 JDK 7: Proposition 9 : Notation de tableau pour List et Map -> Intégrée
				 Répondre avec citation
  Répondre avec citation
 
			 
  
			 
 


 
			 
			 Envoyé par Napalm51
 Envoyé par Napalm51
					






 
			

 
  
			 
   


 
			 
			 
    
						
Partager