Question: How can you take an array and put it into a stack???? I have a card array with a deck of cards that gets shuffled then I need to change it to a stack and print the first number on top. Anyway anyone can help?

Answer: 
You can use [Collections.addAll](https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#addAll(java.util.Collection,%20T...))

```
Card[] cardsArray;
Stack<Card> cards = new Stack<>();
Collections.addAll(cards, cardsArray);

```
To convert array to an stack you need to first convert it to a list and then create a new stack and add all the elements from the list to that stack.
Here you can see the reference answer.

```
    String[] stuff = {"hello", "every", "one"};
    List<String> list = Arrays.asList(stuff); //1 Convert to a List
    //stack.addAll(list); 
    //3 Add all items from the List to the stack.
    // This won't work instead of use the following
    Stack<String> stack = new Stack<String>(); //2 Create new stack
    // this will insert string element in reverse order, so "hello" will be on top of the stack, if you want order to be as it is, just loop i over 0 to stuff.length.
    for(int i = stuff.length - 1; i >= 0; i--) {
        stack.add(stuff[i]);
    }
    System.out.println(stack.pop());//print First Element of Stack

```