1、
private static Hashtable<Integer, Object> table =
new Hashtable<Integer, Object>();
private static int length = 0; // 长度
/**
* hashtable实现put
*/
public static void push(Object b)
{
table.put(length++, b);
}
/**
* Hashtable实现pop
* @return
*/
public static Object pop()
{
if(table.size() == 0)
{
return null;
}
length--;
Object obj = table.remove(length);
return obj;
}