public NameSpace swap(NameSpace newTop){
  NameSpace oldTop=(NameSpace)(stack.elementAt(0));
  stack.setElementAt(newTop,0);
  return oldTop;
}

public NameSpace swap ( NameSpace newTop ) { NameSpace oldTop = ( NameSpace ) ( stack . elementAt ( 0 ) ) ; stack . setElementAt ( newTop , 0 ) ; return oldTop ; }
swap in the value as the new top of the stack and return the old value .
