In your example b will pass but a will throw an error saying
"The method declared in class sub cannot override the method of the same signature declared in class parent."
The method in parent and (a) method in sub class are overridden methods but for the above error. Replace long with int in the sub for (a) solves the problem.
Just remember the rules of overloading and overriding :
overloading - The number and type of parameters should be different. Overloading is related in the same class. overloading of methods is providing alternate implementation for the overloaded methods.
overriding - The number and type of parameters and also the return type should be same. overriding is applicable in parent-sub class. overriding feature totally replaces the implementation of the parent class. An overriding method of subclass can only throw THE CHECKED EXCEPTIONS (OR THEIR SUBCLASSES) thrown by the parent class method. But the overriding methods can throws unchecked exception.
Hope this helps!