Question OOP-EXC-0002
EasyWhich block contains code that might throw an exception?
- A.
try
- B.
throw
- C.
Show answer and explanation
Answer: A
Risky code goes in try; handlers follow in catch (or except in Python).
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Exception Handling question
Which block contains code that might throw an exception?
try
throw
Answer: A
Risky code goes in try; handlers follow in catch (or except in Python).
finally
catch