We know, in the xy-plane, any point on the y-axis will have x=0. Hence, any point on the y-axis is of the form (0,y), where y can be any non-zero number.
Therefore, any point whose x-coordinate is 0 and y-coordinate is non-zero will lie on the y-axis.
But here, if b=0 in the point (a,b), then it clearly lies on the x-axis.