Not every method can be overridden, and overrides must follow rules. If you break any, the compiler rejects your code.
The method signature (name and parameters) must match exactly. Changing a parameter type creates an overload, not an override.
The return type must be the same or a subtype of the parent's return type (covariant return).
The access modifier can't be more restrictive. If the parent method is public, the child can't make it protected.
The override can't throw new checked exceptions that the parent doesn't declare.
static, final, and private methods cannot be overridden. static belongs to the class. final is locked. private isn't visible to the child.