|
我从sun.com考了段程序
------------------------------------
import java.util.*;
public class test{
public static void main(){
Hashtable numbers = new Hashtable();
numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));
numbers.put("three", new Integer(3));
Integer n = (Integer)numbers.get("two");
if (n != null) {
System.out.println("two = " + n);
}
}
}
-------------------------------------
编译无误,但是在运行java test是,出错
---------------------------------------
Exception in thread "main" java.lang.NoSuchMethodError: main
-----------------------------------------
这是怎么回事呢? |
|