Question OOP-EXC-0004
EasyWhich keyword raises an exception in Java and C++?
- A.
throw
- B.
error
- C.
Show answer and explanation
Answer: A
Python uses raise; Java and C++ use throw.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Exception Handling question
Which keyword raises an exception in Java and C++?
throw
error
Answer: A
Python uses raise; Java and C++ use throw.
catch
raise