Question OOP-EXC-0048
MediumWhat is the difference between throw and throws in Java?
- A.
throws raises the exception immediately
- B.
throw is only for errors
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Exception Handling question
What is the difference between throw and throws in Java?
throws raises the exception immediately
throw is only for errors
Sign up free to see the answer and a step-by-step explanation.
They are the same
throw raises an exception; throws in a method signature declares exceptions it may raise