Welcome to the ranch ! Next time, please don't write your subject all in capital letters. (check
this FAQ)
A few comments about your code :
1. You are using instance variables (rand, nameF...) in your method. It makes it difficult to follow, and is prone to undesirable side effects.
2. You are using a while loop with a return statement. I guess you wanted to use an "if" instead.
3. You can lighten your code a bit by using a local variable "Card card = deckOfCards.get(rand);" and use that variable afterwards.
So... You want something like this ?
1. Make a new list. For example, List<Card> hand = new ArrayList<Card>();
2. Make a loop with a counter going up to 6
3. For each iteration:
3.1. Get a card : Card card = pickRandomCard(); (make sure the card is not already picked)
3.2. Add the card the the list : hand.add(card);
Can you figure out the code from that algorithm ?