generic
Hello every body:
I used java 1.5 ;
there is something wrong in the last line;
//////////////////////////////////////////////////////////
import java.util.HashMap;
import java.util.Map;
public class TestMap {
public static void main(String args[]) {
args[0] = "a ";
args[1] = "hello ";
Map <String,Integer> map = new HashMap <String,Integer> ();
for (int i = 0; i < args.length; i++) {
map.put(args[i], i);
}
Integer position = map.get( "hello "); // here something wrong: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
}
}
Who can help me?
Thank you!
------解决方案--------------------我在Eclipse里运行了一下,没有问题。
------解决方案--------------------no problem!