1个回答
展开全部
public Object [] ReverseArray (Object [] array)
{
if (array == null || array.length == 0)
return array ;
Stack stack = new Stack (array.length) ;
for (int i = 0 ; i < array.length ; i ++)
stack.push (array [i]) ;
for (int i = 0 ; i < array.length ; i ++)
array [i] = stack.pop () ;
return array ;
}
{
if (array == null || array.length == 0)
return array ;
Stack stack = new Stack (array.length) ;
for (int i = 0 ; i < array.length ; i ++)
stack.push (array [i]) ;
for (int i = 0 ; i < array.length ; i ++)
array [i] = stack.pop () ;
return array ;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询