accessing a static method

In the program below i'm accessing the staticmethod with the instance of the class which is incorrect and has to throw an error. But it compiles fine and gives the output also correctly why is that so ?