Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public class Pair <K,V> {
  2. private final K key; //non modifiable
  3. private V value;
  4.  
  5. //constructeur
  6. public Pair(K k, V v){
  7. key = k;
  8. value = v;
  9. }
  10.  
  11. public K getKey() {
  12. return key;
  13. }
  14.  
  15. public V getValue() {
  16. return value;
  17. }
  18.  
  19. //Modifie la valeur
  20. public V setV(V v){ //ou void
  21. value =v;
  22. return v;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement