Here you can find the source of stackToTuple(Stack s)
public static Object[] stackToTuple(Stack s)
//package com.java2s; //License from project: Creative Commons License import java.util.Stack; public class Main { /** new Object[0]. Defined as property for caching. */ public static final Object emptyTuple[] = new Object[0]; public static Object[] stackToTuple(Stack s) { if (s.empty()) { return emptyTuple; }/*from w w w .j a va2 s . c om*/ Object[] result = new Object[s.size()]; s.copyInto(result); return result; } }