How is this checkmate? So I'm somewhat of a new player to chess and I'm currently reading a chess book which is explaining all the different terms. In one instance it describes what stalemate is; "If your opponent has no legal legal moves and is not I)in check, then you have stalemate and not checkmate" 

It then gives an example of stalemate and then a non stalemate example which it labels as checkmate. 



The confusion that I have is why it labeled the second one as checkmate. Isn't checkmate when the king piece is in check and there is no legal moves it can make? Thus in the second example it isn't in checkmate because the king can still move around on the 8th rank and there is no immediate danger to it so it isn't in check either... Or does checkmate also include being trapped in a certain row, column or diagonal length with no other moves you can take except to move along those boxes?
The position shown in board 2 is not a checkmate, as you correctly say. 

The book is not completely clear here. The sentence "Checkmate with Queen and King" is only the task of an exercise: you have to set up the position you see on a real board, and move the pieces trying to checkmate the black king using the white Queen and King. The checkmate is not there yet, you have to play and find it. It is not immediate, it will take some moves.