Continuing with the next best hand after a straight:

A   B  
       

Here you have a flush. A flush is five cards of the same suit.

i) The cards do not need to be consecutive, as with a straight
ii) It has to be 5 cards of the same suit. 3 or 4 suited cards are worthless.

If two players both have a flush, it is the player with the highest flush who wins. Therefore hand B (Ace high flush) beats hand A (Queen high flush).


Continuing with the next best hand after a flush:

A   B  
       

Here you have a full house. It is three of a kind and a pair.

It is the highest three of a kind which is the deciding factor. If both hands have the same three of a kind, then it is the pair which decides which hand wins.

Therefore hand B (Queens full of Twos) beats hand A (Sevens full of Tens).