1  class NotePad<K,V>{
2 private K key;
3 private V value;
4 public K getKey() {
5 return key;
6 }
7 public void setKey(K key) {
8 this.key = key;
9 }
10 public V getValue() {
11 return value;
12 }
13 public void setValue(V value) {
14 this.value = value;
15 }
16
17
18 }
19
20 public class dsadas {
21 public static void main(String args[]){
22 Notepad<String,Integer> t=new Notepad<String ,Integer>();
23 t.setKey("李兴华");
24 t.setValue(30);
25 System.out.println("Name:"+t.getKey());
26 System.out.println("Age:"+t.getValue());
27 }
28 }

 

相关文章:

  • 2022-12-23
  • 2021-07-04
  • 2021-07-29
  • 2022-02-23
  • 2022-12-23
  • 2021-11-03
  • 2021-05-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-09-11
  • 2022-12-23
相关资源
相似解决方案