How can an improvement in the quality of software be done by try/catch/throw?



How can an improvement in the quality of software be done by try/catch/throw?..

Answer / Hemant Kumar Singh

Try/catch/throw mechanisms in C++ help to handle exceptions effectively, thereby improving the overall quality of software:

1. Error handling: Try and catch blocks allow you to manage runtime errors more efficiently without leading to unexpected termination or unhandled crashes.
2. Code modularity: By encapsulating error-prone code within try blocks and providing meaningful exception messages using throw, the main logic remains clean and easy to maintain.
3. Robustness: Effective use of exceptions helps improve the robustness of software by making it more resilient against unexpected errors.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

1 Answers   CTS,


What are special characters c++?

1 Answers  


What are Binay tress and B trees? Diff between them?

8 Answers   CTS, GATE, Wipro,


What is the difference between c++ and turbo c++?

1 Answers  


write a programme to get a character and thier ASCII value

1 Answers  


What are the advantages of using typedef in a program?

1 Answers  


What is c++ & why it is used?

1 Answers  


what are Access specifiers in C++ class? What are the types?

1 Answers  


give me some class & objects examples?

1 Answers  


What do you mean by persistent and non persistent objects?

2 Answers  


What is java and c++?

1 Answers  


How much do coding jobs pay?

1 Answers  


Categories