Explain the difference between throw and throws in Java?
Throw | Throws | |
---|---|---|
1. | Used to throw an exception. | Used to declare an exception |
2. | Followed by Exception class instance | Followed by exception class names |
3. | Used in the method body | Used in method signature |
BY Best Interview Question ON 13 Jan 2019