Java Stack Create toStack(int[] input)

Here you can find the source of toStack(int[] input)

Description

to Stack

License

Open Source License

Declaration

public static final Stack<Integer> toStack(int[] input) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Stack;

public class Main {
    public static final Stack<Integer> toStack(int[] input) {
        Stack<Integer> stack = new Stack<>();
        appendToStack(stack, input);/*w w w.j  a  v  a2s.co m*/
        return stack;
    }

    public static final void appendToStack(Stack<Integer> stack, int[] input) {
        for (int inputValue : input) {
            stack.push(inputValue);
        }
    }
}

Related

  1. checkStack(Object object, Class type)
  2. getCharStack()
  3. listToStack(List list)