Need Assistance?

support@tutorialshub.in

Exception Handling in Java

throw vs throws Keyword in Java

ADVERTISEMENT
Java Free Lesson
5 min read
ADVERTISEMENT
  • throw: Used inside a method body to explicitly throw a single exception object (throw new IllegalArgumentException("...");).
  • throws: Used in a method signature to warn callers that this method might pass on checked exceptions.
ADVERTISEMENT
Hi, I'm Tuby! Here to help you