public interface IK { class V{
}
}
比如像上面的定义形式,在真实的设计用有什么用武之地,谢谢
}
}
比如像上面的定义形式,在真实的设计用有什么用武之地,谢谢
解决方案 »
- 多个excel文件,合并成一个excel文件,要求是:原多个excel文件内容对应为生成的excel文件的其中一个工作簿
- 就算你是高手也不一定会做的题,结贴再给出答案。
- 请教,怎么监控一个Java程序是否运行结束?
- java.Swing.Timer问题
- 一段java代码,编译不过去
- 新手求教!!!!
- 我装的是JDK1.4工具用的是JCreator2.5为什么编译的时候老出现这句话,以前没有呀
- 问个初级一点的问题:j2sdk1.4.0_01中2和1.4.0各代表什么意思。
- JAVA的字符串是用什么来结尾的?
- 【源码】文本编码转换器
- 如何让一个类具有两个类的功能(即具有两个类的方法)?
- 请教个字符集问题
假如接口IK只是针对某种数据结构V进行操作,其他类有可能不会再用到V了,那么把V作为IK的内部类,层次管理也方便吧,就像Map和Map.Entry一样吧
接口里定义了一个Entry接口,看看这个东东是怎么用的,或许对你有启发。
java源码
http://www.docjar.com/html/api/java/util/Map.java.html
1 /*
2 * Copyright 2006 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16 package java.util;
17
18 /**
19 * Abstract interface for maps.
20 */
21 public interface Map {
22
23 /**
24 * Represents an individual map entry.
25 */
26 public static interface Entry {
27 boolean equals(Object o);
28
29 Object getKey();
30
31 Object getValue();
32
33 int hashCode();
34
35 Object setValue(Object value);
36 }
37
38 void clear();
39
40 boolean containsKey(Object key);
41
42 boolean containsValue(Object value);
43
44 Set entrySet();
45
46 boolean equals(Object o);
47
48 Object get(Object key);
49
50 int hashCode();
51
52 boolean isEmpty();
53
54 Set keySet();
55
56 Object put(Object key, Object value);
57
58 void putAll(Map t);
59
60 Object remove(Object key);
61
62 int size();
63
64 Collection values();
65 }Read more: http://kickjava.com/src/java/util/Map.java.htm#ixzz1AsVdhaPQ