这是我的示例代码。这会打印出“{test=theClass@7096985e}”,但我需要它来给我类型和范围的值。我已经尝试了几件事——任何方向都会很棒。谢谢!
import java.util.*;
class theClass {
String type;
String scope;
public theClass(String string1, String string2) {
type = string1; scope = string2;
}
}
public class Sandbox {
public static void main(String[] args){
Hashtable<String, theClass> theTable = new Hashtable<String, theClass>();
theClass object = new theClass("int", "global");
theTable.put("test", object);
System.out.println(theTable.toString());
}
}