Why is it a bad idea to throw your own exceptions?
Answer Posted / guest
Well, if at that point you know that an error has occurred,
then why not write the proper code to handle that error
instead of passing a new Exception object to the catch
block? Throwing your own exceptions signifies some design
flaws in the project.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
what will be the output of the given below coding. using System; public class Exercise { static void OddNumbers(int a) { if (a >= 1) { Console.Write("{0}, ", a); a -= 2; OddNumbers(a); } } public static int Main() { const int Number = 9; Console.WriteLine("Odd Numbers"); OddNumbers(Number); Console.WriteLine(); return 0; } }
What are the benefits of using generics in c#?
How do we achieve encapsulation in c#?
What is a nullreferenceexception and how do I fix it?
What is the difference between User controls and Custom Controls?
What is stringreader in c#?
Why we use extension methods in c#?
Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?
Differentiate between static class and singleton instance?
What do you know about Translate Accelerator?
How to put assembly in gac?
What's the difference between system.string and system.text.stringbuilder classes?
Why we use delegates in c#?
What is datatable in c#?
Is c# and c same?