Namespace is the current scope of the segment of code being performed. Line 19 encloses lines 19-23 so any namespace changes inside of that segment will only affect that segment. Thus the call to use namespace Hello at line 20 and the output of message() at line 21 is "Hello". At line 22 the "Goodbye::message()" indicates that you are accessing the "Goodbye" namespace and calling the "message()" function within that namespace. Hence the output "Good-Bye". At line 24 the program is still using the "Good-Bye" namespace as declared at line 18 thus the last call to "message()" will again produce "Good-Bye".
Ok thanks guys. What I was confused about was that I thought line 18 covers ALL the code from line 19 to line 26, therefore conflicting with line 21. But I guess I should have read the section twice. Thanks again, a lot!