Overriding is useful when you want to change the functionality of some method based on a class. For example, by overriding the toString() method of Object class, we can use it with different classes.
Overloading is useful to add flexibility to a method. In general, if you want to create a method that adds two numbers then it only take either integer, double, or float but by overloading, you can add values of all data types.
Java Method Overloading
Java Method Overriding