As we know if any error or any unchecked exception occurs then our program will halt, then what are the differences between those?
From the Error Javadoc:
An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions. The ThreadDeath error, though a "normal" condition, is also a subclass of Error because most applications should not try to catch it.
Versus the Exception Javadoc
The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch.
So, even though an unchecked exception is not required to be caught, you may want to. An error, you don't want to catch.