You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
358 B
18 lines
358 B
public class Pair<K,V>{
|
|
K key;
|
|
V value;
|
|
public Pair(K key,V value){
|
|
this.key=key;
|
|
this.value=value;
|
|
}
|
|
public K getkey(){
|
|
return key;
|
|
}
|
|
public V getvalue(){
|
|
return value;
|
|
}
|
|
public static Pair swap (Pair pair){
|
|
return new Pair(pair.getvalue(),pair.getkey());
|
|
|
|
}
|
|
}
|