functions <keypad.h> ??

Yes, it is the same thing. The first one is from a listing of the keypad functions, but it actually says

char getKey()

Returns the key that is pressed, if any. This function is non-blocking.

meaning that the function getKey() returns a char.

The second is an example of using that function with the keypad object.